The MDN Web Documentation describes the syntax for use in JavaScript standard built in objects methods, using brackets to group the available parameters.
For example:
var new_array = arr.map(function callback(currentValue[, index[, array]]) {
// Return element for new_array
}[, thisArg])
This has been causing some confusion for me while reading the documentation and I can not understand the purpose of grouping the parameters with brackets.
For instance, in the example above, why are the index and array parameters grouped as so.
callback(currentValue[, index[, array]])
Many thanks for your time and help.