Skip to content

Instantly share code, notes, and snippets.

@fazzyA
Last active March 26, 2020 21:22
Show Gist options
  • Save fazzyA/f0a1de74eb61f257a4547dcefef8abad to your computer and use it in GitHub Desktop.
Save fazzyA/f0a1de74eb61f257a4547dcefef8abad to your computer and use it in GitHub Desktop.
Array mehtods Es6 map()
/// 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