Skip to content

Instantly share code, notes, and snippets.

@nicc777
Created September 9, 2019 04:59
Show Gist options
  • Save nicc777/82eac4d804e9905172b378d408ef1af4 to your computer and use it in GitHub Desktop.
Save nicc777/82eac4d804e9905172b378d408ef1af4 to your computer and use it in GitHub Desktop.
Javascript list functions example
// Also refer to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
const numbers = [1, 2, 3];
const doubleNumbers = numbers.map((num) => {
return num * 2;
});
console.log(numbers);
console.log(doubleNumbers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment