This Gist was automatically created by Carbide, a free online programming environment.
Last active
April 15, 2022 14:32
-
-
Save z81/acdb8ce906512c6c41a07750b54bfa83 to your computer and use it in GitHub Desktop.
untitled
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 map = (arr, cb) => { | |
const res = []; | |
for(let v of arr) { | |
res.push(cb(v)); | |
} | |
return res; | |
}; | |
const c = map([1, 2, 3], v => v * 2); | |
const x = [[1, 2], [3, 4]].map(v => v.map(x => x * 2)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment