Created
September 19, 2023 08:51
-
-
Save GrahamTheDevRel/9ba078625dd07acaee2765c86f43f911 to your computer and use it in GitHub Desktop.
array.map() example from MDN
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
const 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
Raw