Skip to content

Instantly share code, notes, and snippets.

@jasocox
Created November 15, 2017 21:48
Show Gist options
  • Save jasocox/4b1db9292d8a8d4b3cf215173a2d945e to your computer and use it in GitHub Desktop.
Save jasocox/4b1db9292d8a8d4b3cf215173a2d945e to your computer and use it in GitHub Desktop.
An example of mapping over data in JavaScript.
var list = [1, 2, 3, 4];
var doubled = list.map(item => item * 2);
console.log(list);
console.log(doubled);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment