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()