Skip to content

ek2k/jsbasics2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Fundamentals Part II

  1. Fork and clone this repository
  2. In the root directory of this folder, run npm install
  3. Add the necessary code in script.js for each function
  4. Run npm test to run the tests
  5. Once the tests pass you are all done!

Problems

  1. Complete the 'Bean Counting' exercise from Chapter 3 of Eloquent Javascript
  2. Complete the 'Sum of a Range' exercise from Chapter 4 of Eloquent Javascript
  3. Complete the 'Reversing an Array' exercise from Chapter 4 of Eloquent Javascript
  4. Create an isPalindrome() function which takes a string as an argument and returns a boolean value: true if the string is a palindrome, and false if not. E.g. isPalindrome("bob") should return true, but isPalindrome("robert") should return false. 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).
  5. A prime number is one that has no divisors other than 1 and itself. Write a function isPrime which takes a single input, a whole number, and returns true if the number is prime and false otherwise.
  6. Write a function findLongestWord that takes an array of words and returns the length of the longest one.
  7. Write a function filterLongWords that takes an array of words and an number i and returns the array of words that are longer than i.
  8. Write a function createObject that takes in two arguments and returns an object with the first argument as the key in the object and the second as the value
  9. Write a function numberObject which 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})
  10. Write a function reverseString which takes a string and returns the string reversed ("awesome" becomes "emosewa")
  11. Write a function called youngestPerson that 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.
  12. Write a function called keys that takes an object and returns an array with all of the keys in the object.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5