From d4c53c5b96aa675a55f7bf701c9e49a8d994ce90 Mon Sep 17 00:00:00 2001 From: Antonio Shivers Date: Fri, 23 Sep 2022 10:05:54 -0400 Subject: [PATCH 1/4] updating lab --- solution.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution.js b/solution.js index 25527e7..ac141e5 100644 --- a/solution.js +++ b/solution.js @@ -8,7 +8,7 @@ const isEveryNumGreaterThan2 = () => { const isEveryWordShorterThan7 = () => { return words.every((word) => word.length < 7); }; - +å // Filter const arrayLessThan5 = () => { From 793892716796a89625b3c8132f65d19775c04a51 Mon Sep 17 00:00:00 2001 From: Antonio Shivers Date: Fri, 23 Sep 2022 10:06:35 -0400 Subject: [PATCH 2/4] updating lab --- solution.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution.js b/solution.js index ac141e5..78e447e 100644 --- a/solution.js +++ b/solution.js @@ -8,7 +8,7 @@ const isEveryNumGreaterThan2 = () => { const isEveryWordShorterThan7 = () => { return words.every((word) => word.length < 7); }; -å +å; // Filter const arrayLessThan5 = () => { From a018c8e719854ee7540051d34b2d2f3336dd936a Mon Sep 17 00:00:00 2001 From: Antonio Shivers Date: Fri, 23 Sep 2022 10:10:31 -0400 Subject: [PATCH 3/4] redoing lab with added tests --- solution.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/solution.js b/solution.js index caaa9e9..575fd71 100644 --- a/solution.js +++ b/solution.js @@ -2,31 +2,30 @@ const { nums, words } = require("./data/data.js"); // Every const isEveryNumGreaterThan2 = () => { - // + return nums.every((num) => num >= 2); }; const isEveryWordShorterThan7 = () => { - // + return words.every((word) => word.length < 7); }; -å; // Filter const arrayLessThan5 = () => { - // + return nums.filter((num) => num < 5); }; const arrayOddLengthWords = () => { - // + return words.filter((word) => word.length % 2 === 1); }; // Find const firstValDivisibleBy4 = () => { - // + return nums.find((num) => num % 4 === 0); }; const firstWordLongerThan4Char = () => { - // + return words.find((word) => word.length > 4); }; // Find Index @@ -42,31 +41,33 @@ const firstWordIndexLessThan2Char = () => { // For Each const logValuesTimes3 = () => { - // + return nums.forEach((num) => console.log((num *= 3))); }; const logWordsWithExclamation = () => { - // + return words.forEach((word) => console.log(`${word}!`)); }; // Map const arrayValuesSquaredTimesIndex = () => { - // + return nums.map((num, index) => { + return Math.pow(num, 2) * index; + }); }; const arrayWordsUpcased = () => { - // + return words.map((word) => word.toUpperCase()); }; // Some const areSomeNumsDivisibleBy7 = () => { - // + return nums.some((num) => num % 7 === 0); }; const doSomeWordsHaveAnA = () => { - // + return words.some((word) => word.toLowerCase().includes("a")); }; module.exports = { From 5c94661e522de67dac76321b163e91501b4fcf6b Mon Sep 17 00:00:00 2001 From: Antonio Shivers Date: Fri, 23 Sep 2022 10:12:26 -0400 Subject: [PATCH 4/4] completed new lab --- solution.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solution.js b/solution.js index 575fd71..2d645cb 100644 --- a/solution.js +++ b/solution.js @@ -31,11 +31,11 @@ const firstWordLongerThan4Char = () => { // Find Index const firstNumIndexDivisibleBy3 = () => { - // + return nums.findIndex((num) => num % 3 === 0); }; const firstWordIndexLessThan2Char = () => { - // + return words.findIndex((word) => word.length < 2); }; // For Each