/javascript-cardio-session-2

some JavaScript coding challenges

Primary LanguageJavaScript

JavaScript Cardio [Session 2] - LongestWord, Anagrams, Array Chunking

YouTube video by Traversy Media

CHALLENGE 1: LONGEST WORD

Return the longest word of a string. If more than one word, put into an array.

CHALLENGE 2: ARRAY CHUNKING

Split an array into chunked arrays of a specific length

ex. chunkArray([1, 2, 3, 4, 5, 6, 7], 3) returns [[1, 2, 3], [4, 5, 6], [7]]

ex. chunkArray([1, 2, 3, 4, 5, 6, 7], 2) returns [[1, 2], [3, 4], [5, 6], [7]]

CHALLENGE 3: FLATTEN ARRAY

Take an array of arrays and flatten to a single array

ex. flattenArray([[1, 2], [3, 4], [5, 6], [7]]) returns [1, 2, 3, 4, 5, 6, 7]

CHALLENGE 4: ANAGRAM

Return true if anagram and false if not

ex. isAnagram('elbow', 'below') returns true

CHALLENGE 5: LETTER CHANGES

Change every letter of the string to the one that fallows it and capitalize the vowels . Z should turn to A

ex. letterChanges('hello there') returns 'Ifmmp UIfsf'