From 55cfb173d8da273146a5c598cb8ea3e9760831fa Mon Sep 17 00:00:00 2001 From: Benjo Kho Date: Sat, 7 Aug 2021 14:21:26 +0800 Subject: [PATCH 01/26] Order exercise folders Ordered the exercise folders by placing their numbers in their folder name --- {helloWorld => 01 helloWorld}/README.md | 0 {helloWorld => 01 helloWorld}/helloWorld.js | 0 {helloWorld => 01 helloWorld}/helloWorld.spec.js | 0 {repeatString => 02 repeatString}/README.md | 0 .../repeatString.js | 0 .../repeatString.spec.js | 0 {reverseString => 03 reverseString}/README.md | 0 .../reverseString.js | 0 .../reverseString.spec.js | 0 .../README.md | 0 .../removeFromArray.js | 0 .../removeFromArray.spec.js | 0 {sumAll => 05 sumAll}/README.md | 0 {sumAll => 05 sumAll}/sumAll.js | 0 {sumAll => 05 sumAll}/sumAll.spec.js | 0 {leapYears => 06 leapYears}/README.md | 0 {leapYears => 06 leapYears}/leapYears.js | 0 {leapYears => 06 leapYears}/leapYears.spec.js | 0 {tempConversion => 07 tempConversion}/README.md | 0 .../tempConversion.js | 0 .../tempConversion.spec.js | 0 {calculator => 08 calculator}/README.md | 0 {calculator => 08 calculator}/calculator.js | 0 {calculator => 08 calculator}/calculator.spec.js | 0 {palindromes => 09 palindromes}/README.md | 0 {palindromes => 09 palindromes}/palindromes.js | 0 .../palindromes.spec.js | 0 {fibonacci => 10 fibonacci}/README.md | 0 {fibonacci => 10 fibonacci}/fibonacci.js | 0 {fibonacci => 10 fibonacci}/fibonacci.spec.js | 0 {getTheTitles => 11 getTheTitles}/README.md | 0 .../getTheTitles.js | 0 .../getTheTitles.spec.js | 0 {findTheOldest => 12 findTheOldest}/README.md | 0 .../findTheOldest.js | 0 .../findTheOldest.spec.js | 0 {caesar => 13 caesar}/README.md | 0 {caesar => 13 caesar}/caesar.js | 0 {caesar => 13 caesar}/caesar.spec.js | 0 caesar/.DS_Store | Bin 6148 -> 0 bytes 40 files changed, 0 insertions(+), 0 deletions(-) rename {helloWorld => 01 helloWorld}/README.md (100%) rename {helloWorld => 01 helloWorld}/helloWorld.js (100%) rename {helloWorld => 01 helloWorld}/helloWorld.spec.js (100%) rename {repeatString => 02 repeatString}/README.md (100%) rename {repeatString => 02 repeatString}/repeatString.js (100%) rename {repeatString => 02 repeatString}/repeatString.spec.js (100%) rename {reverseString => 03 reverseString}/README.md (100%) rename {reverseString => 03 reverseString}/reverseString.js (100%) rename {reverseString => 03 reverseString}/reverseString.spec.js (100%) rename {removeFromArray => 04 removeFromArray}/README.md (100%) rename {removeFromArray => 04 removeFromArray}/removeFromArray.js (100%) rename {removeFromArray => 04 removeFromArray}/removeFromArray.spec.js (100%) rename {sumAll => 05 sumAll}/README.md (100%) rename {sumAll => 05 sumAll}/sumAll.js (100%) rename {sumAll => 05 sumAll}/sumAll.spec.js (100%) rename {leapYears => 06 leapYears}/README.md (100%) rename {leapYears => 06 leapYears}/leapYears.js (100%) rename {leapYears => 06 leapYears}/leapYears.spec.js (100%) rename {tempConversion => 07 tempConversion}/README.md (100%) rename {tempConversion => 07 tempConversion}/tempConversion.js (100%) rename {tempConversion => 07 tempConversion}/tempConversion.spec.js (100%) rename {calculator => 08 calculator}/README.md (100%) rename {calculator => 08 calculator}/calculator.js (100%) rename {calculator => 08 calculator}/calculator.spec.js (100%) rename {palindromes => 09 palindromes}/README.md (100%) rename {palindromes => 09 palindromes}/palindromes.js (100%) rename {palindromes => 09 palindromes}/palindromes.spec.js (100%) rename {fibonacci => 10 fibonacci}/README.md (100%) rename {fibonacci => 10 fibonacci}/fibonacci.js (100%) rename {fibonacci => 10 fibonacci}/fibonacci.spec.js (100%) rename {getTheTitles => 11 getTheTitles}/README.md (100%) rename {getTheTitles => 11 getTheTitles}/getTheTitles.js (100%) rename {getTheTitles => 11 getTheTitles}/getTheTitles.spec.js (100%) rename {findTheOldest => 12 findTheOldest}/README.md (100%) rename {findTheOldest => 12 findTheOldest}/findTheOldest.js (100%) rename {findTheOldest => 12 findTheOldest}/findTheOldest.spec.js (100%) rename {caesar => 13 caesar}/README.md (100%) rename {caesar => 13 caesar}/caesar.js (100%) rename {caesar => 13 caesar}/caesar.spec.js (100%) delete mode 100644 caesar/.DS_Store diff --git a/helloWorld/README.md b/01 helloWorld/README.md similarity index 100% rename from helloWorld/README.md rename to 01 helloWorld/README.md diff --git a/helloWorld/helloWorld.js b/01 helloWorld/helloWorld.js similarity index 100% rename from helloWorld/helloWorld.js rename to 01 helloWorld/helloWorld.js diff --git a/helloWorld/helloWorld.spec.js b/01 helloWorld/helloWorld.spec.js similarity index 100% rename from helloWorld/helloWorld.spec.js rename to 01 helloWorld/helloWorld.spec.js diff --git a/repeatString/README.md b/02 repeatString/README.md similarity index 100% rename from repeatString/README.md rename to 02 repeatString/README.md diff --git a/repeatString/repeatString.js b/02 repeatString/repeatString.js similarity index 100% rename from repeatString/repeatString.js rename to 02 repeatString/repeatString.js diff --git a/repeatString/repeatString.spec.js b/02 repeatString/repeatString.spec.js similarity index 100% rename from repeatString/repeatString.spec.js rename to 02 repeatString/repeatString.spec.js diff --git a/reverseString/README.md b/03 reverseString/README.md similarity index 100% rename from reverseString/README.md rename to 03 reverseString/README.md diff --git a/reverseString/reverseString.js b/03 reverseString/reverseString.js similarity index 100% rename from reverseString/reverseString.js rename to 03 reverseString/reverseString.js diff --git a/reverseString/reverseString.spec.js b/03 reverseString/reverseString.spec.js similarity index 100% rename from reverseString/reverseString.spec.js rename to 03 reverseString/reverseString.spec.js diff --git a/removeFromArray/README.md b/04 removeFromArray/README.md similarity index 100% rename from removeFromArray/README.md rename to 04 removeFromArray/README.md diff --git a/removeFromArray/removeFromArray.js b/04 removeFromArray/removeFromArray.js similarity index 100% rename from removeFromArray/removeFromArray.js rename to 04 removeFromArray/removeFromArray.js diff --git a/removeFromArray/removeFromArray.spec.js b/04 removeFromArray/removeFromArray.spec.js similarity index 100% rename from removeFromArray/removeFromArray.spec.js rename to 04 removeFromArray/removeFromArray.spec.js diff --git a/sumAll/README.md b/05 sumAll/README.md similarity index 100% rename from sumAll/README.md rename to 05 sumAll/README.md diff --git a/sumAll/sumAll.js b/05 sumAll/sumAll.js similarity index 100% rename from sumAll/sumAll.js rename to 05 sumAll/sumAll.js diff --git a/sumAll/sumAll.spec.js b/05 sumAll/sumAll.spec.js similarity index 100% rename from sumAll/sumAll.spec.js rename to 05 sumAll/sumAll.spec.js diff --git a/leapYears/README.md b/06 leapYears/README.md similarity index 100% rename from leapYears/README.md rename to 06 leapYears/README.md diff --git a/leapYears/leapYears.js b/06 leapYears/leapYears.js similarity index 100% rename from leapYears/leapYears.js rename to 06 leapYears/leapYears.js diff --git a/leapYears/leapYears.spec.js b/06 leapYears/leapYears.spec.js similarity index 100% rename from leapYears/leapYears.spec.js rename to 06 leapYears/leapYears.spec.js diff --git a/tempConversion/README.md b/07 tempConversion/README.md similarity index 100% rename from tempConversion/README.md rename to 07 tempConversion/README.md diff --git a/tempConversion/tempConversion.js b/07 tempConversion/tempConversion.js similarity index 100% rename from tempConversion/tempConversion.js rename to 07 tempConversion/tempConversion.js diff --git a/tempConversion/tempConversion.spec.js b/07 tempConversion/tempConversion.spec.js similarity index 100% rename from tempConversion/tempConversion.spec.js rename to 07 tempConversion/tempConversion.spec.js diff --git a/calculator/README.md b/08 calculator/README.md similarity index 100% rename from calculator/README.md rename to 08 calculator/README.md diff --git a/calculator/calculator.js b/08 calculator/calculator.js similarity index 100% rename from calculator/calculator.js rename to 08 calculator/calculator.js diff --git a/calculator/calculator.spec.js b/08 calculator/calculator.spec.js similarity index 100% rename from calculator/calculator.spec.js rename to 08 calculator/calculator.spec.js diff --git a/palindromes/README.md b/09 palindromes/README.md similarity index 100% rename from palindromes/README.md rename to 09 palindromes/README.md diff --git a/palindromes/palindromes.js b/09 palindromes/palindromes.js similarity index 100% rename from palindromes/palindromes.js rename to 09 palindromes/palindromes.js diff --git a/palindromes/palindromes.spec.js b/09 palindromes/palindromes.spec.js similarity index 100% rename from palindromes/palindromes.spec.js rename to 09 palindromes/palindromes.spec.js diff --git a/fibonacci/README.md b/10 fibonacci/README.md similarity index 100% rename from fibonacci/README.md rename to 10 fibonacci/README.md diff --git a/fibonacci/fibonacci.js b/10 fibonacci/fibonacci.js similarity index 100% rename from fibonacci/fibonacci.js rename to 10 fibonacci/fibonacci.js diff --git a/fibonacci/fibonacci.spec.js b/10 fibonacci/fibonacci.spec.js similarity index 100% rename from fibonacci/fibonacci.spec.js rename to 10 fibonacci/fibonacci.spec.js diff --git a/getTheTitles/README.md b/11 getTheTitles/README.md similarity index 100% rename from getTheTitles/README.md rename to 11 getTheTitles/README.md diff --git a/getTheTitles/getTheTitles.js b/11 getTheTitles/getTheTitles.js similarity index 100% rename from getTheTitles/getTheTitles.js rename to 11 getTheTitles/getTheTitles.js diff --git a/getTheTitles/getTheTitles.spec.js b/11 getTheTitles/getTheTitles.spec.js similarity index 100% rename from getTheTitles/getTheTitles.spec.js rename to 11 getTheTitles/getTheTitles.spec.js diff --git a/findTheOldest/README.md b/12 findTheOldest/README.md similarity index 100% rename from findTheOldest/README.md rename to 12 findTheOldest/README.md diff --git a/findTheOldest/findTheOldest.js b/12 findTheOldest/findTheOldest.js similarity index 100% rename from findTheOldest/findTheOldest.js rename to 12 findTheOldest/findTheOldest.js diff --git a/findTheOldest/findTheOldest.spec.js b/12 findTheOldest/findTheOldest.spec.js similarity index 100% rename from findTheOldest/findTheOldest.spec.js rename to 12 findTheOldest/findTheOldest.spec.js diff --git a/caesar/README.md b/13 caesar/README.md similarity index 100% rename from caesar/README.md rename to 13 caesar/README.md diff --git a/caesar/caesar.js b/13 caesar/caesar.js similarity index 100% rename from caesar/caesar.js rename to 13 caesar/caesar.js diff --git a/caesar/caesar.spec.js b/13 caesar/caesar.spec.js similarity index 100% rename from caesar/caesar.spec.js rename to 13 caesar/caesar.spec.js diff --git a/caesar/.DS_Store b/caesar/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Sat, 7 Aug 2021 14:52:11 +0800 Subject: [PATCH 02/26] Rename folders with numbers and underscores --- {01 helloWorld => 01_helloWorld}/README.md | 0 {01 helloWorld => 01_helloWorld}/helloWorld.js | 0 {01 helloWorld => 01_helloWorld}/helloWorld.spec.js | 0 {02 repeatString => 02_repeatString}/README.md | 0 {02 repeatString => 02_repeatString}/repeatString.js | 0 {02 repeatString => 02_repeatString}/repeatString.spec.js | 0 03 reverseString/reverseString.js | 5 ----- {03 reverseString => 03_reverseString}/README.md | 0 03_reverseString/reverseString.js | 5 +++++ .../reverseString.spec.js | 6 +++--- {04 removeFromArray => 04_removeFromArray}/README.md | 0 .../removeFromArray.js | 0 .../removeFromArray.spec.js | 0 {05 sumAll => 05_sumAll}/README.md | 0 {05 sumAll => 05_sumAll}/sumAll.js | 0 {05 sumAll => 05_sumAll}/sumAll.spec.js | 0 {06 leapYears => 06_leapYears}/README.md | 0 {06 leapYears => 06_leapYears}/leapYears.js | 0 {06 leapYears => 06_leapYears}/leapYears.spec.js | 0 {07 tempConversion => 07_tempConversion}/README.md | 0 {07 tempConversion => 07_tempConversion}/tempConversion.js | 0 .../tempConversion.spec.js | 0 {08 calculator => 08_calculator}/README.md | 0 {08 calculator => 08_calculator}/calculator.js | 0 {08 calculator => 08_calculator}/calculator.spec.js | 0 {09 palindromes => 09_palindromes}/README.md | 0 {09 palindromes => 09_palindromes}/palindromes.js | 0 {09 palindromes => 09_palindromes}/palindromes.spec.js | 0 {10 fibonacci => 10_fibonacci}/README.md | 0 {10 fibonacci => 10_fibonacci}/fibonacci.js | 0 {10 fibonacci => 10_fibonacci}/fibonacci.spec.js | 0 {11 getTheTitles => 11_getTheTitles}/README.md | 0 {11 getTheTitles => 11_getTheTitles}/getTheTitles.js | 0 {11 getTheTitles => 11_getTheTitles}/getTheTitles.spec.js | 0 {12 findTheOldest => 12_findTheOldest}/README.md | 0 {12 findTheOldest => 12_findTheOldest}/findTheOldest.js | 0 .../findTheOldest.spec.js | 0 {13 caesar => 13_caesar}/README.md | 0 {13 caesar => 13_caesar}/caesar.js | 0 {13 caesar => 13_caesar}/caesar.spec.js | 0 40 files changed, 8 insertions(+), 8 deletions(-) rename {01 helloWorld => 01_helloWorld}/README.md (100%) rename {01 helloWorld => 01_helloWorld}/helloWorld.js (100%) rename {01 helloWorld => 01_helloWorld}/helloWorld.spec.js (100%) rename {02 repeatString => 02_repeatString}/README.md (100%) rename {02 repeatString => 02_repeatString}/repeatString.js (100%) rename {02 repeatString => 02_repeatString}/repeatString.spec.js (100%) delete mode 100644 03 reverseString/reverseString.js rename {03 reverseString => 03_reverseString}/README.md (100%) create mode 100644 03_reverseString/reverseString.js rename {03 reverseString => 03_reverseString}/reverseString.spec.js (70%) rename {04 removeFromArray => 04_removeFromArray}/README.md (100%) rename {04 removeFromArray => 04_removeFromArray}/removeFromArray.js (100%) rename {04 removeFromArray => 04_removeFromArray}/removeFromArray.spec.js (100%) rename {05 sumAll => 05_sumAll}/README.md (100%) rename {05 sumAll => 05_sumAll}/sumAll.js (100%) rename {05 sumAll => 05_sumAll}/sumAll.spec.js (100%) rename {06 leapYears => 06_leapYears}/README.md (100%) rename {06 leapYears => 06_leapYears}/leapYears.js (100%) rename {06 leapYears => 06_leapYears}/leapYears.spec.js (100%) rename {07 tempConversion => 07_tempConversion}/README.md (100%) rename {07 tempConversion => 07_tempConversion}/tempConversion.js (100%) rename {07 tempConversion => 07_tempConversion}/tempConversion.spec.js (100%) rename {08 calculator => 08_calculator}/README.md (100%) rename {08 calculator => 08_calculator}/calculator.js (100%) rename {08 calculator => 08_calculator}/calculator.spec.js (100%) rename {09 palindromes => 09_palindromes}/README.md (100%) rename {09 palindromes => 09_palindromes}/palindromes.js (100%) rename {09 palindromes => 09_palindromes}/palindromes.spec.js (100%) rename {10 fibonacci => 10_fibonacci}/README.md (100%) rename {10 fibonacci => 10_fibonacci}/fibonacci.js (100%) rename {10 fibonacci => 10_fibonacci}/fibonacci.spec.js (100%) rename {11 getTheTitles => 11_getTheTitles}/README.md (100%) rename {11 getTheTitles => 11_getTheTitles}/getTheTitles.js (100%) rename {11 getTheTitles => 11_getTheTitles}/getTheTitles.spec.js (100%) rename {12 findTheOldest => 12_findTheOldest}/README.md (100%) rename {12 findTheOldest => 12_findTheOldest}/findTheOldest.js (100%) rename {12 findTheOldest => 12_findTheOldest}/findTheOldest.spec.js (100%) rename {13 caesar => 13_caesar}/README.md (100%) rename {13 caesar => 13_caesar}/caesar.js (100%) rename {13 caesar => 13_caesar}/caesar.spec.js (100%) diff --git a/01 helloWorld/README.md b/01_helloWorld/README.md similarity index 100% rename from 01 helloWorld/README.md rename to 01_helloWorld/README.md diff --git a/01 helloWorld/helloWorld.js b/01_helloWorld/helloWorld.js similarity index 100% rename from 01 helloWorld/helloWorld.js rename to 01_helloWorld/helloWorld.js diff --git a/01 helloWorld/helloWorld.spec.js b/01_helloWorld/helloWorld.spec.js similarity index 100% rename from 01 helloWorld/helloWorld.spec.js rename to 01_helloWorld/helloWorld.spec.js diff --git a/02 repeatString/README.md b/02_repeatString/README.md similarity index 100% rename from 02 repeatString/README.md rename to 02_repeatString/README.md diff --git a/02 repeatString/repeatString.js b/02_repeatString/repeatString.js similarity index 100% rename from 02 repeatString/repeatString.js rename to 02_repeatString/repeatString.js diff --git a/02 repeatString/repeatString.spec.js b/02_repeatString/repeatString.spec.js similarity index 100% rename from 02 repeatString/repeatString.spec.js rename to 02_repeatString/repeatString.spec.js diff --git a/03 reverseString/reverseString.js b/03 reverseString/reverseString.js deleted file mode 100644 index c5ebf916f98..00000000000 --- a/03 reverseString/reverseString.js +++ /dev/null @@ -1,5 +0,0 @@ -const reverseString = function() { - -}; - -module.exports = reverseString; diff --git a/03 reverseString/README.md b/03_reverseString/README.md similarity index 100% rename from 03 reverseString/README.md rename to 03_reverseString/README.md diff --git a/03_reverseString/reverseString.js b/03_reverseString/reverseString.js new file mode 100644 index 00000000000..ad79ce03216 --- /dev/null +++ b/03_reverseString/reverseString.js @@ -0,0 +1,5 @@ +const reverseString = function(str) { + let newStr = str.split("").reverse().join(""); +}; + +module.exports = reverseString; diff --git a/03 reverseString/reverseString.spec.js b/03_reverseString/reverseString.spec.js similarity index 70% rename from 03 reverseString/reverseString.spec.js rename to 03_reverseString/reverseString.spec.js index 8adb88775bb..b51c50ea857 100644 --- a/03 reverseString/reverseString.spec.js +++ b/03_reverseString/reverseString.spec.js @@ -5,14 +5,14 @@ describe('reverseString', () => { expect(reverseString('hello')).toEqual('olleh'); }); - test.skip('reverses multiple words', () => { + test('reverses multiple words', () => { expect(reverseString('hello there')).toEqual('ereht olleh') }) - test.skip('works with numbers and punctuation', () => { + test('works with numbers and punctuation', () => { expect(reverseString('123! abc!')).toEqual('!cba !321') }) - test.skip('works with blank strings', () => { + test('works with blank strings', () => { expect(reverseString('')).toEqual('') }) }); diff --git a/04 removeFromArray/README.md b/04_removeFromArray/README.md similarity index 100% rename from 04 removeFromArray/README.md rename to 04_removeFromArray/README.md diff --git a/04 removeFromArray/removeFromArray.js b/04_removeFromArray/removeFromArray.js similarity index 100% rename from 04 removeFromArray/removeFromArray.js rename to 04_removeFromArray/removeFromArray.js diff --git a/04 removeFromArray/removeFromArray.spec.js b/04_removeFromArray/removeFromArray.spec.js similarity index 100% rename from 04 removeFromArray/removeFromArray.spec.js rename to 04_removeFromArray/removeFromArray.spec.js diff --git a/05 sumAll/README.md b/05_sumAll/README.md similarity index 100% rename from 05 sumAll/README.md rename to 05_sumAll/README.md diff --git a/05 sumAll/sumAll.js b/05_sumAll/sumAll.js similarity index 100% rename from 05 sumAll/sumAll.js rename to 05_sumAll/sumAll.js diff --git a/05 sumAll/sumAll.spec.js b/05_sumAll/sumAll.spec.js similarity index 100% rename from 05 sumAll/sumAll.spec.js rename to 05_sumAll/sumAll.spec.js diff --git a/06 leapYears/README.md b/06_leapYears/README.md similarity index 100% rename from 06 leapYears/README.md rename to 06_leapYears/README.md diff --git a/06 leapYears/leapYears.js b/06_leapYears/leapYears.js similarity index 100% rename from 06 leapYears/leapYears.js rename to 06_leapYears/leapYears.js diff --git a/06 leapYears/leapYears.spec.js b/06_leapYears/leapYears.spec.js similarity index 100% rename from 06 leapYears/leapYears.spec.js rename to 06_leapYears/leapYears.spec.js diff --git a/07 tempConversion/README.md b/07_tempConversion/README.md similarity index 100% rename from 07 tempConversion/README.md rename to 07_tempConversion/README.md diff --git a/07 tempConversion/tempConversion.js b/07_tempConversion/tempConversion.js similarity index 100% rename from 07 tempConversion/tempConversion.js rename to 07_tempConversion/tempConversion.js diff --git a/07 tempConversion/tempConversion.spec.js b/07_tempConversion/tempConversion.spec.js similarity index 100% rename from 07 tempConversion/tempConversion.spec.js rename to 07_tempConversion/tempConversion.spec.js diff --git a/08 calculator/README.md b/08_calculator/README.md similarity index 100% rename from 08 calculator/README.md rename to 08_calculator/README.md diff --git a/08 calculator/calculator.js b/08_calculator/calculator.js similarity index 100% rename from 08 calculator/calculator.js rename to 08_calculator/calculator.js diff --git a/08 calculator/calculator.spec.js b/08_calculator/calculator.spec.js similarity index 100% rename from 08 calculator/calculator.spec.js rename to 08_calculator/calculator.spec.js diff --git a/09 palindromes/README.md b/09_palindromes/README.md similarity index 100% rename from 09 palindromes/README.md rename to 09_palindromes/README.md diff --git a/09 palindromes/palindromes.js b/09_palindromes/palindromes.js similarity index 100% rename from 09 palindromes/palindromes.js rename to 09_palindromes/palindromes.js diff --git a/09 palindromes/palindromes.spec.js b/09_palindromes/palindromes.spec.js similarity index 100% rename from 09 palindromes/palindromes.spec.js rename to 09_palindromes/palindromes.spec.js diff --git a/10 fibonacci/README.md b/10_fibonacci/README.md similarity index 100% rename from 10 fibonacci/README.md rename to 10_fibonacci/README.md diff --git a/10 fibonacci/fibonacci.js b/10_fibonacci/fibonacci.js similarity index 100% rename from 10 fibonacci/fibonacci.js rename to 10_fibonacci/fibonacci.js diff --git a/10 fibonacci/fibonacci.spec.js b/10_fibonacci/fibonacci.spec.js similarity index 100% rename from 10 fibonacci/fibonacci.spec.js rename to 10_fibonacci/fibonacci.spec.js diff --git a/11 getTheTitles/README.md b/11_getTheTitles/README.md similarity index 100% rename from 11 getTheTitles/README.md rename to 11_getTheTitles/README.md diff --git a/11 getTheTitles/getTheTitles.js b/11_getTheTitles/getTheTitles.js similarity index 100% rename from 11 getTheTitles/getTheTitles.js rename to 11_getTheTitles/getTheTitles.js diff --git a/11 getTheTitles/getTheTitles.spec.js b/11_getTheTitles/getTheTitles.spec.js similarity index 100% rename from 11 getTheTitles/getTheTitles.spec.js rename to 11_getTheTitles/getTheTitles.spec.js diff --git a/12 findTheOldest/README.md b/12_findTheOldest/README.md similarity index 100% rename from 12 findTheOldest/README.md rename to 12_findTheOldest/README.md diff --git a/12 findTheOldest/findTheOldest.js b/12_findTheOldest/findTheOldest.js similarity index 100% rename from 12 findTheOldest/findTheOldest.js rename to 12_findTheOldest/findTheOldest.js diff --git a/12 findTheOldest/findTheOldest.spec.js b/12_findTheOldest/findTheOldest.spec.js similarity index 100% rename from 12 findTheOldest/findTheOldest.spec.js rename to 12_findTheOldest/findTheOldest.spec.js diff --git a/13 caesar/README.md b/13_caesar/README.md similarity index 100% rename from 13 caesar/README.md rename to 13_caesar/README.md diff --git a/13 caesar/caesar.js b/13_caesar/caesar.js similarity index 100% rename from 13 caesar/caesar.js rename to 13_caesar/caesar.js diff --git a/13 caesar/caesar.spec.js b/13_caesar/caesar.spec.js similarity index 100% rename from 13 caesar/caesar.spec.js rename to 13_caesar/caesar.spec.js From 3236ae156ccc536c34435b134e6232d1f930bc3c Mon Sep 17 00:00:00 2001 From: Benjo Kho Date: Sat, 7 Aug 2021 14:54:14 +0800 Subject: [PATCH 03/26] Revert edits --- 03_reverseString/reverseString.js | 2 +- 03_reverseString/reverseString.spec.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/03_reverseString/reverseString.js b/03_reverseString/reverseString.js index ad79ce03216..5ce90acaf71 100644 --- a/03_reverseString/reverseString.js +++ b/03_reverseString/reverseString.js @@ -1,5 +1,5 @@ const reverseString = function(str) { - let newStr = str.split("").reverse().join(""); + }; module.exports = reverseString; diff --git a/03_reverseString/reverseString.spec.js b/03_reverseString/reverseString.spec.js index b51c50ea857..8adb88775bb 100644 --- a/03_reverseString/reverseString.spec.js +++ b/03_reverseString/reverseString.spec.js @@ -5,14 +5,14 @@ describe('reverseString', () => { expect(reverseString('hello')).toEqual('olleh'); }); - test('reverses multiple words', () => { + test.skip('reverses multiple words', () => { expect(reverseString('hello there')).toEqual('ereht olleh') }) - test('works with numbers and punctuation', () => { + test.skip('works with numbers and punctuation', () => { expect(reverseString('123! abc!')).toEqual('!cba !321') }) - test('works with blank strings', () => { + test.skip('works with blank strings', () => { expect(reverseString('')).toEqual('') }) }); From 79e57ddceca16915f87f1be24beac9736cecb546 Mon Sep 17 00:00:00 2001 From: davidnth <63354482+davidnth@users.noreply.github.com> Date: Sun, 8 Aug 2021 14:59:21 +1000 Subject: [PATCH 04/26] Update README.md An explanation of debugging in visual studio code. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d0442a37145..3dca05a9b53 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,9 @@ Each exercise includes 3 files: a markdown file with a description of the task, The first exercise, `helloWorld`, will walk you through the process in-depth. +## Debugging +To debug functions, you can run the tests in the visual code studio debugger terminal (open this by clicking the "Run and Debug" icon on the left or pressing ctrl + shift + D, then clicking JavaScript Debug Terminal). In your code you are able to set breakpoints as you would in the Chrome devtools debugger. You can run `npm test exerciseName.spec.js` to then execute your code up until your breakpoint and step through your code as necessary. + ## Solutions Solutions for these exercises can be found in this repo on the 'solutions' branch. From 702d983059d9317749741a231abdc35a45267c61 Mon Sep 17 00:00:00 2001 From: davidnth <63354482+davidnth@users.noreply.github.com> Date: Sun, 8 Aug 2021 15:14:12 +1000 Subject: [PATCH 05/26] Update README.md Co-authored-by: Tatiana --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dca05a9b53..ee105206ea4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Each exercise includes 3 files: a markdown file with a description of the task, The first exercise, `helloWorld`, will walk you through the process in-depth. ## Debugging -To debug functions, you can run the tests in the visual code studio debugger terminal (open this by clicking the "Run and Debug" icon on the left or pressing ctrl + shift + D, then clicking JavaScript Debug Terminal). In your code you are able to set breakpoints as you would in the Chrome devtools debugger. You can run `npm test exerciseName.spec.js` to then execute your code up until your breakpoint and step through your code as necessary. +To debug functions, you can run the tests in the Visual Studio Code debugger terminal. You can open this by clicking the "Run and Debug" icon on the left or pressing `ctrl + shift + D`, then clicking JavaScript Debug Terminal. You will be able to set breakpoints as you would in the Chrome DevTools debugger. You can run `npm test exerciseName.spec.js` to then execute your code up until your breakpoint and step through your code as necessary. **NOTE**: To take advantage of the debugger, you **MUST** run the script in the debugger terminal, not the bash or zsh terminal. ## Solutions From f0456531e429528830fac77eac452b5af554ae65 Mon Sep 17 00:00:00 2001 From: Mike Esposito Date: Fri, 13 Aug 2021 08:46:05 -0700 Subject: [PATCH 06/26] Add paragraph to repeatString describing arguments --- 02_repeatString/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/02_repeatString/README.md b/02_repeatString/README.md index 01c6100b14c..43b789313e5 100644 --- a/02_repeatString/README.md +++ b/02_repeatString/README.md @@ -6,6 +6,10 @@ Write a function that simply repeats the string a given number of times: repeatString('hey', 3) // returns 'heyheyhey' ``` +This function will take two arguments, `string` and `num`. + +*Note:* The exercises after this one will not have arguments provided as this one does - you will need to provide them yourself from now on. So read each exercise's README carefully to see what kinds of arguments will be expected. + You will notice in this exercise that there are multiple tests (see in file `repeatString.spec.js`). Only the first test is currently enabled. So after making sure that this first one passes, enable the others one by one by deleting the `.skip` from the `test.skip()` function. From 6274682cb51ec000072d7e6a00b095261a3cbc84 Mon Sep 17 00:00:00 2001 From: Mike Esposito Date: Fri, 13 Aug 2021 08:51:38 -0700 Subject: [PATCH 07/26] Merge two bullet points in repeatString --- 02_repeatString/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/02_repeatString/README.md b/02_repeatString/README.md index 43b789313e5..9c8123e2f8b 100644 --- a/02_repeatString/README.md +++ b/02_repeatString/README.md @@ -21,11 +21,9 @@ You will notice in this exercise that there are multiple tests (see in file `rep - Create a variable to hold the string you're going to return, create a loop that repeats the given number of times and add the given string to the result on each loop. -- If running `npm test repeatString.spec.js` returns results similar to the below: +- If running `npm test repeatString.spec.js` returns results similar to the below, make sure you have enabled the rest of the tests, as described in the instructions above. ``` Test Suites: 1 passed, 1 total Tests: 6 skipped, 1 passed, 7 total ``` - -- Make sure you have enabled the rest of the tests (see above). From cb083f5511ffe90343203bc483d5a94c2fcaa10c Mon Sep 17 00:00:00 2001 From: Vishant Nambiar Date: Sun, 29 Aug 2021 19:43:34 +0530 Subject: [PATCH 08/26] replaced semicolon with single quote in caesar --- 13_caesar/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/13_caesar/README.md b/13_caesar/README.md index ba6d36bb643..dbce19559bd 100644 --- a/13_caesar/README.md +++ b/13_caesar/README.md @@ -14,7 +14,7 @@ caesar('A', 1) // simply shifts the letter by 1: returns 'B' the cipher should retain capitalization: ```javascript -caesar('Hey', 5) // returns 'Mjd; +caesar('Hey', 5) // returns 'Mjd' ``` should _not_ shift punctuation: From 74ab0b7cc6e67ac13c8f1af337f59595633aafa9 Mon Sep 17 00:00:00 2001 From: Briggs Elsperger Date: Sat, 11 Sep 2021 16:18:19 -0600 Subject: [PATCH 09/26] add clarifiying comment about not removing code --- 02_repeatString/repeatString.js | 1 + 03_reverseString/reverseString.js | 1 + 04_removeFromArray/removeFromArray.js | 1 + 05_sumAll/sumAll.js | 1 + 06_leapYears/leapYears.js | 1 + 07_tempConversion/tempConversion.js | 1 + 08_calculator/calculator.js | 1 + 09_palindromes/palindromes.js | 1 + 10_fibonacci/fibonacci.js | 1 + 11_getTheTitles/getTheTitles.js | 1 + 12_findTheOldest/findTheOldest.js | 1 + 13_caesar/caesar.js | 1 + pigLatin/pigLatin.js | 3 ++- snakeCase/snakeCase.js | 1 + 14 files changed, 15 insertions(+), 1 deletion(-) diff --git a/02_repeatString/repeatString.js b/02_repeatString/repeatString.js index 34926ed62be..4359bbea06e 100644 --- a/02_repeatString/repeatString.js +++ b/02_repeatString/repeatString.js @@ -2,4 +2,5 @@ const repeatString = function() { }; +// Do not edit below this line module.exports = repeatString; diff --git a/03_reverseString/reverseString.js b/03_reverseString/reverseString.js index 5ce90acaf71..b6d0a9a2d32 100644 --- a/03_reverseString/reverseString.js +++ b/03_reverseString/reverseString.js @@ -2,4 +2,5 @@ const reverseString = function(str) { }; +// Do not edit below this line module.exports = reverseString; diff --git a/04_removeFromArray/removeFromArray.js b/04_removeFromArray/removeFromArray.js index 80880df1371..1bedeb06de3 100644 --- a/04_removeFromArray/removeFromArray.js +++ b/04_removeFromArray/removeFromArray.js @@ -2,4 +2,5 @@ const removeFromArray = function() { }; +// Do not edit below this line module.exports = removeFromArray; diff --git a/05_sumAll/sumAll.js b/05_sumAll/sumAll.js index aab00af6828..00880c753c8 100644 --- a/05_sumAll/sumAll.js +++ b/05_sumAll/sumAll.js @@ -2,4 +2,5 @@ const sumAll = function() { }; +// Do not edit below this line module.exports = sumAll; diff --git a/06_leapYears/leapYears.js b/06_leapYears/leapYears.js index 68e3af84daa..681eeeff383 100644 --- a/06_leapYears/leapYears.js +++ b/06_leapYears/leapYears.js @@ -2,4 +2,5 @@ const leapYears = function() { }; +// Do not edit below this line module.exports = leapYears; diff --git a/07_tempConversion/tempConversion.js b/07_tempConversion/tempConversion.js index 85e28a51987..6ef3e85c406 100644 --- a/07_tempConversion/tempConversion.js +++ b/07_tempConversion/tempConversion.js @@ -6,6 +6,7 @@ const ctof = function() { }; +// Do not edit below this line module.exports = { ftoc, ctof diff --git a/08_calculator/calculator.js b/08_calculator/calculator.js index 51109d7f111..c22e8d28640 100644 --- a/08_calculator/calculator.js +++ b/08_calculator/calculator.js @@ -22,6 +22,7 @@ const factorial = function() { }; +// Do not edit below this line module.exports = { add, subtract, diff --git a/09_palindromes/palindromes.js b/09_palindromes/palindromes.js index d81830472c2..8d2101875c6 100644 --- a/09_palindromes/palindromes.js +++ b/09_palindromes/palindromes.js @@ -2,4 +2,5 @@ const palindromes = function () { }; +// Do not edit below this line module.exports = palindromes; diff --git a/10_fibonacci/fibonacci.js b/10_fibonacci/fibonacci.js index 1afa45a383f..bb2c8cc403d 100644 --- a/10_fibonacci/fibonacci.js +++ b/10_fibonacci/fibonacci.js @@ -2,4 +2,5 @@ const fibonacci = function() { }; +// Do not edit below this line module.exports = fibonacci; diff --git a/11_getTheTitles/getTheTitles.js b/11_getTheTitles/getTheTitles.js index 6fb7d68f89a..74b04df890f 100644 --- a/11_getTheTitles/getTheTitles.js +++ b/11_getTheTitles/getTheTitles.js @@ -2,4 +2,5 @@ const getTheTitles = function() { }; +// Do not edit below this line module.exports = getTheTitles; diff --git a/12_findTheOldest/findTheOldest.js b/12_findTheOldest/findTheOldest.js index c7808b173c4..366856aa183 100644 --- a/12_findTheOldest/findTheOldest.js +++ b/12_findTheOldest/findTheOldest.js @@ -2,4 +2,5 @@ const findTheOldest = function() { }; +// Do not edit below this line module.exports = findTheOldest; diff --git a/13_caesar/caesar.js b/13_caesar/caesar.js index 23355cfabb4..c61d2f86662 100644 --- a/13_caesar/caesar.js +++ b/13_caesar/caesar.js @@ -2,4 +2,5 @@ const caesar = function() { }; +// Do not edit below this line module.exports = caesar; diff --git a/pigLatin/pigLatin.js b/pigLatin/pigLatin.js index c2a557c5a41..162abffb548 100644 --- a/pigLatin/pigLatin.js +++ b/pigLatin/pigLatin.js @@ -2,4 +2,5 @@ function pigLatin(string) { }; - module.exports = pigLatin; +// Do not edit below this line +module.exports = pigLatin; diff --git a/snakeCase/snakeCase.js b/snakeCase/snakeCase.js index bb0910b4839..6df3af3fdcb 100644 --- a/snakeCase/snakeCase.js +++ b/snakeCase/snakeCase.js @@ -2,4 +2,5 @@ const snakeCase = function() { }; +// Do not edit below this line module.exports = snakeCase; From e4f9675628fa8c6a0189213faf96043c5140b684 Mon Sep 17 00:00:00 2001 From: Mohammed Sobhi <63759344+mohammedsobhi@users.noreply.github.com> Date: Wed, 22 Sep 2021 19:02:34 +0200 Subject: [PATCH 10/26] fix 'says hello world' in README.md change 'says hello world' to 'says "Hello, World!" ' to be identical to the code in the (helloWorld.spec.js) file. --- 01_helloWorld/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01_helloWorld/README.md b/01_helloWorld/README.md index e79ae19b30f..17f71103be1 100644 --- a/01_helloWorld/README.md +++ b/01_helloWorld/README.md @@ -13,7 +13,7 @@ Let's look at the spec file first: const helloWorld = require('./helloWorld'); describe('Hello World', function() { - test('says hello world', function() { + test('says "Hello, World!"', function() { expect(helloWorld()).toEqual('Hello, World!'); }); }); From 36e36b5278a194fb42aaa3b3892cc714d5652aba Mon Sep 17 00:00:00 2001 From: HiddenOgre28 <72028038+HiddenOgre28@users.noreply.github.com> Date: Thu, 25 Nov 2021 09:19:17 -0300 Subject: [PATCH 11/26] Fixed a typo in line 41 Corrected the word "this" so it starts with an upper case "T". --- 01_helloWorld/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01_helloWorld/README.md b/01_helloWorld/README.md index 17f71103be1..d4b267e6d6d 100644 --- a/01_helloWorld/README.md +++ b/01_helloWorld/README.md @@ -38,7 +38,7 @@ Go ahead and see if you can make the test pass by editing the return value of th Just to make sure, in case you're confused at this point, the test is telling you that running the function `helloWorld` should return the phrase `Hello, World!`. Punctuation and capitalization definitely matter here, so double check that if the test still isn't passing. -this is what the final function should look like: +This is what the final function should look like: ```javascript const helloWorld = function() { return 'Hello, World!' From 6527372e9415f907d8ce9b99a674b89e11f8ee6a Mon Sep 17 00:00:00 2001 From: chagstep1 <43247844+chagstep1@users.noreply.github.com> Date: Mon, 27 Dec 2021 19:32:43 +0300 Subject: [PATCH 12/26] Remove predefined parameter from reverseString.js Making it consistent with other exercise setups --- 03_reverseString/reverseString.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03_reverseString/reverseString.js b/03_reverseString/reverseString.js index b6d0a9a2d32..f6790f067dd 100644 --- a/03_reverseString/reverseString.js +++ b/03_reverseString/reverseString.js @@ -1,4 +1,4 @@ -const reverseString = function(str) { +const reverseString = function() { }; From 09806f109ae2e82561a6a4e61851664d389ae210 Mon Sep 17 00:00:00 2001 From: gerijeb Date: Sat, 1 Jan 2022 21:50:35 -0300 Subject: [PATCH 13/26] Fix typo --- 02_repeatString/repeatString.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02_repeatString/repeatString.spec.js b/02_repeatString/repeatString.spec.js index 1bcee3c2ad5..912ac20e7f5 100644 --- a/02_repeatString/repeatString.spec.js +++ b/02_repeatString/repeatString.spec.js @@ -28,7 +28,7 @@ describe('repeatString', () => { const number = Math.floor(Math.random() * 1000) /*The .match(/((hey))/g).length is a regex that will count the number of heys in the result, which if your function works correctly will equal the number that - was randomaly generated. */ + was randomly generated. */ expect(repeatString('hey', number).match(/((hey))/g).length).toEqual(number); }); test.skip('works with blank strings', () => { From 7a9377f6750582dac099469a1b02d0b0e168baa6 Mon Sep 17 00:00:00 2001 From: conor Date: Tue, 18 Jan 2022 21:09:59 +0000 Subject: [PATCH 14/26] Update NPM instruction to new lesson link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee105206ea4..3ed997acf6b 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ There will eventually be a suggested order of completion, but at this time since ## How To Use These Exercises Before you start you should have a few things installed on your machine: -1. **NPM**. To check if you have NPM installed, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, do NOT follow the instructions in the terminal to install with `apt-get`. (This causes permission issues.) Instead, install Node with NVM by following the instructions [here](https://github.com/TheOdinProject/curriculum/blob/master/foundations/installations/installing_node.md). +1. **NPM**. We should have installed NPM already in [this Installing Node.js lesson](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js). Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, do NOT follow the instructions in the terminal to install with `apt-get`. (This causes permission issues.) Instead, go back to the installation lesson and install Node with NVM by following the instructions there. 2. **A copy of this repository**. Copies of repositories on your machine are called clones. If you need help cloning, you can learn how [here](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository). 3. **Jest**. After cloning this repository to your local machine, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. From 1acdfccb5d991b1c106ff3281d5afaaa8a93c433 Mon Sep 17 00:00:00 2001 From: Mclilzee Date: Tue, 8 Feb 2022 20:52:06 +0100 Subject: [PATCH 15/26] Fix palindromes false positive test --- 09_palindromes/palindromes.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/09_palindromes/palindromes.spec.js b/09_palindromes/palindromes.spec.js index 2f239d33f65..6e14ed134e9 100644 --- a/09_palindromes/palindromes.spec.js +++ b/09_palindromes/palindromes.spec.js @@ -17,6 +17,6 @@ describe('palindromes', () => { expect(palindromes('Animal loots foliated detail of stool lamina.')).toBe(true); }); test.skip('doesn\'t just always return true', () => { - expect(palindromes('ZZZZ car, a man, a maraca.')).toBe(false); + expect(palindromes('ZZZZ car, a man, a maracaz.')).toBe(false); }); }); From 1b43007a26f5cbc371690b63e76a5e6f6ca616f8 Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Mon, 14 Feb 2022 14:59:03 -0500 Subject: [PATCH 16/26] Update README.md --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 3ed997acf6b..aebc27d0d98 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,23 @@ -These are a series of JavaScript exercises intended to be used alongside the curriculum at 'The Odin Project'. They start simple and easy but get more complex and involved as you progress through them. +# JavaScript Exercises -There will eventually be a suggested order of completion, but at this time since we are still in the process of creating more exercises the order is subject to change and has not yet been specified. However, there are a few exercises that make a good "starting point". Feel free to at least start with these: +These JavaScript exercises are intended to complement the JavaScript content on The Odin Project (TOP). They should only be done when instructed during the course of the curriculum. -1. Hello World -2. Repeat String -3. Reverse String +**Note:** The `generator-exercise` file is not actually an exercise; it is a script that generates exercises. It was created to help efficiently write these exercises. + +## Contributing + +If you have a suggestion to improve an exercise, an idea for a new exercise, or notice an issue with an exercise, please feel free to open an issue after thoroughly reading our [contributing guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) in our main TOP repo. ## How To Use These Exercises Before you start you should have a few things installed on your machine: 1. **NPM**. We should have installed NPM already in [this Installing Node.js lesson](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js). Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, do NOT follow the instructions in the terminal to install with `apt-get`. (This causes permission issues.) Instead, go back to the installation lesson and install Node with NVM by following the instructions there. -2. **A copy of this repository**. Copies of repositories on your machine are called clones. If you need help cloning, you can learn how [here](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository). +2. **A fork and clone of this repository**. To learn how to fork a repository, see the GitHub documentation on how to [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). + - Copies of repositories on your machine are called clones. If you need help cloning to your local environment you can learn how from the GitHub documentation on [cloning a repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository). 3. **Jest**. After cloning this repository to your local machine, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. -Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass. Some of the exercises have test conditions defined in their spec file that are defined as 'test.skip' compared to 'test'. This is purposeful. After you pass your first 'test', you will change the next 'test.skip' to an 'test' and test your code again. You'll do this until all conditions are satisfied. **ALL TESTS MUST PASS AT THE SAME TIME.** +Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass. + +Some of the exercises have test conditions defined in their spec file that are defined as 'test.skip' compared to 'test'. This is purposeful. After you pass your first 'test', you will change the next 'test.skip' to 'test' and test your code again. You'll do this until all conditions are satisfied. **ALL TESTS MUST PASS AT THE SAME TIME.** **Note**: Due to the way Jest handles failed tests, it may return an exit code of 1 if any tests fail. NPM will interpret this as an error and you may see some `npm ERR!` messages after Jest runs. You can ignore these, or run your test with `npm test exerciseName.spec.js --silent` to supress the errors. @@ -24,7 +29,3 @@ To debug functions, you can run the tests in the Visual Studio Code debugger ter ## Solutions Solutions for these exercises can be found in this repo on the 'solutions' branch. - -## A quick note! - -The exercise `generator-exercise` is not actually an exercise; it is a script that generates exercises. It was created to help efficiently write these exercises. From 6dd594c9008e6348286d35bdf3732cba7d33b878 Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Mon, 14 Feb 2022 15:07:50 -0500 Subject: [PATCH 17/26] Create PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..8879cb7d525 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ + + + +- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) +- [ ] The title of this PR follows the `where the change occurs: brief description of change` format, e.g. `Intro to HTML and CSS lesson: Fix link text` + + +- [ ] If one exists, I have linked a related open issue to this PR in Step 2 below +- [ ] If changes were requested, I have made them and re-requested a review from the maintainer (top of the right sidebar) + +**1. Description of the Changes** + + + +**2. Related Issue** + +Closes #XXXXX From baa5b0a7610f3a80b6fb63de1030c0d894d8cfe9 Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Mon, 14 Feb 2022 15:09:20 -0500 Subject: [PATCH 18/26] Create bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000000..e2b4e5761d4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug Report +about: Create a report to help us improve +title: '' +labels: 'Status: Needs Review, Type: Bug' +assignees: '' + +--- + + + +- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) +- [ ] The title of this issue follows the `where the change occurs: brief description of bug` format, e.g. `React section: Knowledge Checks don't link to resource` + + +- [ ] I would like to be assigned this issue to work on it + +**1. Description of the Bug** + + + +**2. How To Reproduce** + + + +**3. Expected Behavior** + + + +**4. Desktop/Device:** + - Device: + - OS: + - Browser: + - Version: + +**5. Additional Information** + + From 417ee0d6e5bd719d9bd75fa526c8148282ca9d85 Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Mon, 14 Feb 2022 15:09:44 -0500 Subject: [PATCH 19/26] Create feature_request.md --- .github/ISSUE_TEMPLATE/feature_request.md | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000000..3dd36af712d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature Request +about: Suggest a new feature or enhancement for this project +title: '' +labels: 'Status: Needs Review' +assignees: '' + +--- + + + +- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) +- [ ] The title of this issue follows the `where the change occurs: brief description of request` format, e.g. `Global SCSS file: Buttons should have XYZ` + + +- [ ] I would like to be assigned this issue to work on it + +**1. Description of the Feature Request** + + + +**2. Additional Information** + + From edb9c244b547f42fd47a73ae7d284cc6b53bc567 Mon Sep 17 00:00:00 2001 From: Jeremy Myers Date: Mon, 14 Feb 2022 16:05:00 -0500 Subject: [PATCH 20/26] Remove irrelevant text about order of completion --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ed997acf6b..c8e74484d99 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ These are a series of JavaScript exercises intended to be used alongside the curriculum at 'The Odin Project'. They start simple and easy but get more complex and involved as you progress through them. -There will eventually be a suggested order of completion, but at this time since we are still in the process of creating more exercises the order is subject to change and has not yet been specified. However, there are a few exercises that make a good "starting point". Feel free to at least start with these: - -1. Hello World -2. Repeat String -3. Reverse String - ## How To Use These Exercises + Before you start you should have a few things installed on your machine: + 1. **NPM**. We should have installed NPM already in [this Installing Node.js lesson](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js). Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, do NOT follow the instructions in the terminal to install with `apt-get`. (This causes permission issues.) Instead, go back to the installation lesson and install Node with NVM by following the instructions there. 2. **A copy of this repository**. Copies of repositories on your machine are called clones. If you need help cloning, you can learn how [here](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository). 3. **Jest**. After cloning this repository to your local machine, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. @@ -19,6 +15,7 @@ Each exercise includes 3 files: a markdown file with a description of the task, The first exercise, `helloWorld`, will walk you through the process in-depth. ## Debugging + To debug functions, you can run the tests in the Visual Studio Code debugger terminal. You can open this by clicking the "Run and Debug" icon on the left or pressing `ctrl + shift + D`, then clicking JavaScript Debug Terminal. You will be able to set breakpoints as you would in the Chrome DevTools debugger. You can run `npm test exerciseName.spec.js` to then execute your code up until your breakpoint and step through your code as necessary. **NOTE**: To take advantage of the debugger, you **MUST** run the script in the debugger terminal, not the bash or zsh terminal. ## Solutions From 076059551a0c99d0c5d8551f7ad9449ed9211870 Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Wed, 16 Feb 2022 17:41:44 -0500 Subject: [PATCH 21/26] Update README.md --- README.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index cfc59d48b0f..d698763fcab 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,18 @@ If you have a suggestion to improve an exercise, an idea for a new exercise, or ## How To Use These Exercises -Before you start you should have a few things installed on your machine: - -1. **NPM**. We should have installed NPM already in [this Installing Node.js lesson](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js). Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, do NOT follow the instructions in the terminal to install with `apt-get`. (This causes permission issues.) Instead, go back to the installation lesson and install Node with NVM by following the instructions there. -2. **A fork and clone of this repository**. To learn how to fork a repository, see the GitHub documentation on how to [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). - - Copies of repositories on your machine are called clones. If you need help cloning to your local environment you can learn how from the GitHub documentation on [cloning a repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository). -3. **Jest**. After cloning this repository to your local machine, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. - -Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass. - -Some of the exercises have test conditions defined in their spec file that are defined as 'test.skip' compared to 'test'. This is purposeful. After you pass your first 'test', you will change the next 'test.skip' to 'test' and test your code again. You'll do this until all conditions are satisfied. **ALL TESTS MUST PASS AT THE SAME TIME.** +1. Before you start you should have a few things installed on your machine: + * **NPM**. We should have installed NPM already in our [Installing Node.js](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js) lesson. Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, **do not follow the instructions in the terminal** to install with `apt-get` as this causes permission issues. Instead, go back to the installation lesson and install Node with NVM by following the instructions there. + * **Jest**. After cloning this repository to your local machine, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. +2. Fork and clone this repository. To learn how to fork a repository, see the GitHub documentation on how to [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). + * Copies of repositories on your machine are called clones. If you need help cloning to your local environment you can learn how from the GitHub documentation on [cloning a repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository). +3. Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. + * When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass. +4. Some of the exercises have test conditions defined in their spec file as `test.skip` compared to `test`. This is purposeful. After you pass one `test`, you will change the next `test.skip` to `test` and test your code again. You'll do this until all conditions are satisfied. **All tests must pass at the same time**, and you should not have any `test.skip` instances by the time you finish an exercise. +5. Once you successfully finish an exercise, check TOP's `solutions` branch to compare it with yours. + * You should not be checking the solution for an exercise until you finish it! + * Keep in mind that TOP's solution is not the only solution. Generally as long as all of the tests pass, your solution should be fine. +6. Do not submit your solutions to this repo, as any PRs that do so will be closed without merging. **Note**: Due to the way Jest handles failed tests, it may return an exit code of 1 if any tests fail. NPM will interpret this as an error and you may see some `npm ERR!` messages after Jest runs. You can ignore these, or run your test with `npm test exerciseName.spec.js --silent` to supress the errors. @@ -28,7 +30,3 @@ The first exercise, `helloWorld`, will walk you through the process in-depth. ## Debugging To debug functions, you can run the tests in the Visual Studio Code debugger terminal. You can open this by clicking the "Run and Debug" icon on the left or pressing `ctrl + shift + D`, then clicking JavaScript Debug Terminal. You will be able to set breakpoints as you would in the Chrome DevTools debugger. You can run `npm test exerciseName.spec.js` to then execute your code up until your breakpoint and step through your code as necessary. **NOTE**: To take advantage of the debugger, you **MUST** run the script in the debugger terminal, not the bash or zsh terminal. - -## Solutions - -Solutions for these exercises can be found in this repo on the 'solutions' branch. From 67d4d0afec84a5a8b886b443999bc6406884f2df Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Wed, 16 Feb 2022 22:01:13 -0500 Subject: [PATCH 22/26] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d698763fcab..c90ecc6f6a2 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ If you have a suggestion to improve an exercise, an idea for a new exercise, or ## How To Use These Exercises -1. Before you start you should have a few things installed on your machine: - * **NPM**. We should have installed NPM already in our [Installing Node.js](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js) lesson. Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, **do not follow the instructions in the terminal** to install with `apt-get` as this causes permission issues. Instead, go back to the installation lesson and install Node with NVM by following the instructions there. - * **Jest**. After cloning this repository to your local machine, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. -2. Fork and clone this repository. To learn how to fork a repository, see the GitHub documentation on how to [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). +1. Fork and clone this repository. To learn how to fork a repository, see the GitHub documentation on how to [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). * Copies of repositories on your machine are called clones. If you need help cloning to your local environment you can learn how from the GitHub documentation on [cloning a repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository). +2. Before you start working on any execises, you should first ensure you have the following installed: + * **NPM**. You should have installed NPM already in our [Installing Node.js](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js) lesson. Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, **do not follow the instructions in the terminal** to install with `apt-get` as this causes permission issues. Instead, go back to the installation lesson and install Node with NVM by following the instructions there. + * **Jest**. After cloning this repository to your local machine and installing NPM, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. 3. Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. * When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass. 4. Some of the exercises have test conditions defined in their spec file as `test.skip` compared to `test`. This is purposeful. After you pass one `test`, you will change the next `test.skip` to `test` and test your code again. You'll do this until all conditions are satisfied. **All tests must pass at the same time**, and you should not have any `test.skip` instances by the time you finish an exercise. From f002e3d6d0ff49d01905032e717a26b7bfb6cf7b Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Sun, 20 Feb 2022 13:20:37 -0500 Subject: [PATCH 23/26] Update feature_request.md --- .github/ISSUE_TEMPLATE/feature_request.md | 42 +++++++++++++++-------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 3dd36af712d..4814cc25f48 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,24 +1,38 @@ --- name: Feature Request -about: Suggest a new feature or enhancement for this project -title: '' -labels: 'Status: Needs Review' -assignees: '' - +about: Suggest a new feature or enhancement for this project +title: "" +labels: "Status: Needs Review" +assignees: "" --- + - -- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) -- [ ] The title of this issue follows the `where the change occurs: brief description of request` format, e.g. `Global SCSS file: Buttons should have XYZ` +Complete the following REQUIRED checkboxes: +- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) +- [ ] The title of this issue follows the `location for request: brief description of request` format, e.g. `Exercises: Add exercise on XYZ` + +The following checkbox is OPTIONAL: + +- [ ] I would like to be assigned this issue to work on it + +
+ +**1. Description of the Feature Request:** + - -- [ ] I would like to be assigned this issue to work on it -**1. Description of the Feature Request** - +**2. Acceptance Criteria:** + -**2. Additional Information** - +**3. Additional Information:** + From f82c72f76046051857eacac0a79076c48966ae54 Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Sun, 20 Feb 2022 13:21:49 -0500 Subject: [PATCH 24/26] Update bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 56 ++++++++++++++++++---------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index e2b4e5761d4..4c4571c422c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,38 +1,54 @@ --- name: Bug Report -about: Create a report to help us improve -title: '' -labels: 'Status: Needs Review, Type: Bug' -assignees: '' - +about: Create a report to help us improve something that is not working correctly +title: "Bug - :" +labels: "Status: Needs Review, Type: Bug" +assignees: "" --- + - -- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) -- [ ] The title of this issue follows the `where the change occurs: brief description of bug` format, e.g. `React section: Knowledge Checks don't link to resource` +Complete the following REQUIRED checkboxes: +- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) +- [ ] The title of this issue follows the `Bug - location of bug: brief description of bug` format, e.g. `Bug - Exercises: File type incorrect for all test files` + +The following checkbox is OPTIONAL: + +- [ ] I would like to be assigned this issue to work on it - -- [ ] I would like to be assigned this issue to work on it +
-**1. Description of the Bug** +**1. Description of the Bug:** -**2. How To Reproduce** - +**2. How To Reproduce:** + -**3. Expected Behavior** - +**3. Expected Behavior:** + **4. Desktop/Device:** - - Device: - - OS: - - Browser: - - Version: + +- Device: +- OS: +- Browser: +- Version: -**5. Additional Information** +**5. Additional Information:** From 649f0e3771a8173309aded9f9b573e37572b493b Mon Sep 17 00:00:00 2001 From: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com> Date: Sun, 20 Feb 2022 13:25:26 -0500 Subject: [PATCH 25/26] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 37 +++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8879cb7d525..5a8d2e022f5 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,19 +1,30 @@ - + - -- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) -- [ ] The title of this PR follows the `where the change occurs: brief description of change` format, e.g. `Intro to HTML and CSS lesson: Fix link text` +Complete the following REQUIRED checkboxes: + +- [ ] I have thoroughly read and understand [The Odin Project Contributing Guide](https://github.com/TheOdinProject/theodinproject/blob/main/CONTRIBUTING.md) +- [ ] The title of this PR follows the `location of change: brief description of change` format, e.g. `01_helloWorld: Update test cases` - -- [ ] If one exists, I have linked a related open issue to this PR in Step 2 below -- [ ] If changes were requested, I have made them and re-requested a review from the maintainer (top of the right sidebar) +Complete the following checkboxes ONLY IF they are applicable to your PR. You can complete them later if they are not currently applicable: +- [ ] I have ensured any exercise files included in this PR have passed all of their tests -**1. Description of the Changes** - +
+**1. Because:** + +Otherwise, provide a clear and concise reason for your pull request, e.g. what problem it solves or what benefit it provides. If this PR is related to, but does not close, another issue or PR, you can also link it as above without the 'Closes' keyword, e.g. "Related to #2013". + --> Closes #XXXXX + + +**2. This PR:** + + + +**3. Additional Information:** + + From 0747078d979d7752de6706ffb7227d1d161f0b34 Mon Sep 17 00:00:00 2001 From: Kevin Mulhern Date: Sun, 27 Mar 2022 13:51:06 +0100 Subject: [PATCH 26/26] Updated Installing Node JS lesson URL Because: * We have updated our lesson urls --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c90ecc6f6a2..0d607a98f2e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you have a suggestion to improve an exercise, an idea for a new exercise, or 1. Fork and clone this repository. To learn how to fork a repository, see the GitHub documentation on how to [fork a repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo). * Copies of repositories on your machine are called clones. If you need help cloning to your local environment you can learn how from the GitHub documentation on [cloning a repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository-from-github/cloning-a-repository). 2. Before you start working on any execises, you should first ensure you have the following installed: - * **NPM**. You should have installed NPM already in our [Installing Node.js](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/installing-node-js) lesson. Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, **do not follow the instructions in the terminal** to install with `apt-get` as this causes permission issues. Instead, go back to the installation lesson and install Node with NVM by following the instructions there. + * **NPM**. You should have installed NPM already in our [Installing Node.js](https://www.theodinproject.com/lessons/foundations-installing-node-js) lesson. Just in case you need to check, type `npm --version` in your terminal. If you get back `Command 'npm' not found, but can be installed with:`, **do not follow the instructions in the terminal** to install with `apt-get` as this causes permission issues. Instead, go back to the installation lesson and install Node with NVM by following the instructions there. * **Jest**. After cloning this repository to your local machine and installing NPM, go into the newly created directory (`cd javascript-exercises`) and run `npm install`. This will install Jest and set up the testing platform based on our preconfigured settings. 3. Each exercise includes 3 files: a markdown file with a description of the task, an empty (or mostly empty) JavaScript file, and a set of tests. To complete an exercise, you'll need to go to the exercise directory with `cd exerciseName` in the terminal and run `npm test exerciseName.spec.js`. This should run the test file and show you the output. * When you first run a test, it will fail. This is by design! You must open the exercise file and write the code needed to get the test to pass.