- Fork and clone this repository
- In the root directory of this folder, run
npm install - Add the necessary code in
script.jsfor each function - Run
npm testto run the tests - Once the tests pass you are all done!
- Complete the 'Bean Counting' exercise from Chapter 3 of Eloquent Javascript
- Complete the 'Sum of a Range' exercise from Chapter 4 of Eloquent Javascript
- Complete the 'Reversing an Array' exercise from Chapter 4 of Eloquent Javascript
- Create an
isPalindrome()function which takes a string as an argument and returns a boolean value:trueif the string is a palindrome, andfalseif not. E.g.isPalindrome("bob")should returntrue, butisPalindrome("robert")should returnfalse. Bonus Write the function so that it ignores capitalization of letters. Bonus bonus Write the function so that it also ignores whitespaces and punctuation (so that "A man, a plan, a canal, Panama" would be classified as a palindrome). - A prime number is one that has no divisors other than 1 and itself. Write a function
isPrimewhich takes a single input, a whole number, and returnstrueif the number is prime andfalseotherwise. - Write a function
findLongestWordthat takes an array of words and returns the length of the longest one. - Write a function
filterLongWordsthat takes an array of words and an number i and returns the array of words that are longer than i. - Write a function
createObjectthat takes in two arguments and returns an object with the first argument as the key in the object and the second as the value - Write a function
numberObjectwhich takes in a number and returns an object with the keys being all the numbers up to the first argument and the values being the numbers up to the first argument times 5. (numberObject(4) returns{0:0,1:5,2:10,3:15}) - Write a function
reverseStringwhich takes a string and returns the string reversed ("awesome" becomes "emosewa") - Write a function called
youngestPersonthat takes an array of objects with names as keys and ages as values (e.g., [{'Tom': 22, 'Jane': 46}]), and then returns the name of the youngest living person. - Write a function called
keysthat takes an object and returns an array with all of the keys in the object.