Created
August 30, 2019 07:37
Star
You must be signed in to star a gist
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
//simple example | |
function repeat(n, action) { | |
for (let i = 0; i < n; i++) { | |
action(i); | |
} | |
} | |
repeat(3, console.log); | |
//array methods map/reduce/forEach etc | |
const arr1 = [1, 2, 3]; | |
const arr2 = arr1.map(function(item) { | |
return item * 2; | |
}); | |
console.log(arr2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment