I was looking at a few things in Javascript. When I got to the call() function I had a look at this on the mozilla js developer page:
Syntax:
fun.call(thisArg[, arg1[, arg2[, ...]]])
I understand what the function does and how it operates but what on earth is that syntax trying to say? Why is there a comma right after that bracket?
[,
Similarly when I was looking up the reduce() function I understand how it works but the syntax shows this:
arr.reduce(callback[, initialValue])
Shouldn't this be something like arr.reduce(callback, initialvalue) instead?
As a noob, the syntax leads me to believe that callback is an array and it has an empty first element and a second element called initialValue. Is there somewhere that I can read about this syntax so that it makes sense, or could some kind person please provide me with some clarity?
EDIT: Also callback refers to a function yes? So why is it callback[] and not callback()?