Created
September 9, 2019 04:59
-
-
Save nicc777/82eac4d804e9905172b378d408ef1af4 to your computer and use it in GitHub Desktop.
Javascript list functions example
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
// 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