Last active
March 26, 2020 21:22
-
-
Save fazzyA/f0a1de74eb61f257a4547dcefef8abad to your computer and use it in GitHub Desktop.
Array mehtods Es6 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
/// map() goes through every item and return it or perform some function | |
const array = [2,3,6,9,12]; | |
array.map((item)=>item*item); | |
//[4, 9, 36, 81, 144] output | |
const cars = ['toyota', 'alto', 'civic']; | |
cars.map((item)=>item.toUpperCase()) | |
//['TOYOTA','ALTO','CIVIC'] output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment