Last active
June 9, 2018 00:43
-
-
Save OtavioBraga/9e24f340ece7c2018515bf34818b652f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Criamos um array | |
var myArray = [15,30,35] | |
// Criamos a função que será passada ao map | |
function double(item) { | |
return item * 2 | |
} | |
// Atribuímos o resultado do map a uma variável | |
const doubles = myArray.map(double) | |
console.log(doubles) | |
// [30,60,70] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment