Last active
October 20, 2017 14:04
-
-
Save isacjunior/ffbca76c30e07b57af29f49335a2f7cf 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
const map = (array, transform) => { | |
mapped = [] | |
for(let i = 0; i < array.length; i++) | |
mapped.push(transform(array[i])) | |
return mapped | |
} | |
const mapAges = map(users, element => element.age) // [26, 55, 29, 49, 19, 25, 26, 32] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment