Isiaka Lukman
Web Developer
Great post. I love the idea of cows and fences - I have a feeling I'm going to be picturing those cows in their fence every time I write a function now haha!
Awesome explanation, but I think you made a mistake here :
the code above doubles the number in the array and logs it in the console. . .
Here is how variable sum will be logged
function doubleThaNumbers(){
const digits = [1,2,3,4,5,6];
const sum = digits.map(function(n){
return n*2
})
console.log(sum)
}
doubleThaNumbers()
Michael Zwierzanski
Learning to code from scratch. Not bootcamp, just the trusty internet.
Thanks for writing this Isiaka. It's rather helpful, conceptually speaking.