Created
May 31, 2018 08:57
-
-
Save TheMagoo73/016121001d009fd5451cdfe9d67c1053 to your computer and use it in GitHub Desktop.
A quick demo of the forEach and map higher-order functions in JS
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
var data = ["fred", "ann", "bob", "nina"]; | |
console.log("Original data: ") | |
data.forEach(d => console.log(d)); | |
data = data.map(d => "test-" + d); | |
console.log("Updated data: ") | |
data.forEach(d => console.log(d)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment