Skip to content

Instantly share code, notes, and snippets.

@eternal44
Last active May 8, 2019 01:15
Show Gist options
  • Save eternal44/e7de1299e504708aecc74ea3723bdd5a to your computer and use it in GitHub Desktop.
Save eternal44/e7de1299e504708aecc74ea3723bdd5a to your computer and use it in GitHub Desktop.
function foo(arg1, arg2, cb) {
return arg1 + arg2 + cb(4)
}
console.log(foo(1, 2, function(num) {
return num + 2
}))
var myArr = [1,2,3]
myArr.forEach(function(num, index, collection) {
collection[index] = 'boo'
})
var myArr = [1,2,3]
myArr.forEach(function(num, index, collection) {
return num + 2
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment