Week 14 - Wednesday, July 21

Class Video

Practice Problems

Write a function that returns an array that is the same as the input array, except that the distance is converted to miles (*.621371)

Write a function that returns the elements in the array that have a distance < 1000

Write a function that returns the total distance of all the elements in the array.

Write a function that returns the total distance (in miles) of all of the items that are < 1000 km

Write a function capitalize that takes a string and uses .map to return the same string in all caps.

// ex. capitalize('whoop') // => 'WHOOP'

Now write a new function called swapCase that takes a string of words and uses .map and your newly written capitalize() function to return a string where every other word is in all caps.

Write a function that takes a string and returns an object representing the character count for each letter. Use .reduce to build this object.

ex. countLetters('abbcccddddeeeee') => {a:1, b:2, c:3, d:4, e:5}

Binary Search Algorithm

Last updated

Was this helpful?