Created
July 25, 2017 15:23
-
-
Save saracope/4097176f3c6ae87e6af29e3896e6b6d1 to your computer and use it in GitHub Desktop.
JavaScript map()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JavaScript map() | |
Use it when: You want to translate/map all elements in an array to another set of values. | |
Exercises for .map(): | |
1.) Given an array of words, transform that to contain the length of each word. | |
2.) Given an array of dollar values, transform it to contain the values converted to another currency (your choice). | |
3.) Given and array of numbers 1-7, transform it to contain the corresponding day of the week. 1 is equal to Monday. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment