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 69% rename from repeatString/README.md rename to 02_repeatString/README.md index 01c6100..9c8123e 100644 --- a/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. @@ -17,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). 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/03_reverseString/reverseString.js b/03_reverseString/reverseString.js new file mode 100644 index 0000000..5ce90ac --- /dev/null +++ b/03_reverseString/reverseString.js @@ -0,0 +1,5 @@ +const reverseString = function(str) { + +}; + +module.exports = reverseString; 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/README.md b/README.md index d0442a3..ee10520 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 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. diff --git a/caesar/.DS_Store b/caesar/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/caesar/.DS_Store and /dev/null differ diff --git a/reverseString/reverseString.js b/reverseString/reverseString.js deleted file mode 100644 index 0c6fbb1..0000000 --- a/reverseString/reverseString.js +++ /dev/null @@ -1,5 +0,0 @@ -const reverseString = function(string) { - return string.split('').reverse().join('') -}; - -module.exports = reverseString;