Skip to content

Instantly share code, notes, and snippets.

@hadnazzar
Created January 15, 2019 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadnazzar/63398a0c9e5db8233fb0cb575807e667 to your computer and use it in GitHub Desktop.
Save hadnazzar/63398a0c9e5db8233fb0cb575807e667 to your computer and use it in GitHub Desktop.
var array1 = [1, 4, 9, 16];
// pass a function to map
const map1 = array1.map(x => x * 2);
console.log(map1);
// expected output: Array [2, 8, 18, 32]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment