From 85cf56521efc3852ac859f8204f2bf0bc4a5c12a Mon Sep 17 00:00:00 2001 From: TEldridge Date: Mon, 10 Aug 2020 15:43:19 -0500 Subject: [PATCH 1/3] three passing number tests --- src/numbers/index.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/numbers/index.js b/src/numbers/index.js index 014b8ca..9c9d7a4 100644 --- a/src/numbers/index.js +++ b/src/numbers/index.js @@ -1,15 +1,36 @@ +const { numbers } = require("..") +const totalled = require("totalled"); +const { stubTrue } = require("lodash"); + const isEven = (num) => { // write code for numbers.isEven - + if (num % 2 == 0) + return true } + + const sum = (arr) => { // write code for numbers.sum + let total = totalled(arr) + return total } + + + + const comboSum = (arr, sum) => { + for (let i = 0; i < arr.length; i ++){ + for (let j = i + 1; j < arr.length; j++){ + if (arr[i] + arr[j] === 14) + return true + } + + } // write code for numbers.comboSum + return false } From 36ef8774fd03707b7401fc2289fcdd3975c372c7 Mon Sep 17 00:00:00 2001 From: TEldridge Date: Mon, 10 Aug 2020 16:16:25 -0500 Subject: [PATCH 2/3] three passing strings --- src/strings/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/strings/index.js b/src/strings/index.js index eee93b9..58dfc40 100644 --- a/src/strings/index.js +++ b/src/strings/index.js @@ -1,14 +1,21 @@ -const split = (str, delim) => { - // write code for strings.split +const src = require("..") +const split = (str) => { + // write code for strings.split +return str.split("-") } const pairs = (str) => { // write code for strings.pairs + return str.match(/(..?)/g) } const reverse = (str) => { + let splitString = str.split("") + let reverse = splitString.reverse() + let rejoin = reverse.join("") + return rejoin // write code for strings.reverse } From 92decdc320041e3420c96a2a490f7884d5dddbc2 Mon Sep 17 00:00:00 2001 From: TEldridge Date: Mon, 10 Aug 2020 17:09:06 -0500 Subject: [PATCH 3/3] all dates passing, project completed --- src/dates/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dates/index.js b/src/dates/index.js index 91cdc8e..30afd0c 100644 --- a/src/dates/index.js +++ b/src/dates/index.js @@ -1,18 +1,23 @@ // import moment here; use this package in each function -const today = () => { +const moment = require("moment") + +const today = () => { + + return moment().format('dddd'); // write code for dates.today } const calendar = () => { + return moment().format('ll') // write code for dates.calendar } const currentTime = () => { // write code for dates.currentTime - + return moment().format("hh:mm:ss A"); } module.exports = {