javascript - Regarding some document syntax expressions '[,'
滿天的星座2017-05-24 11:38:27
0
3
854
1. I often see some sample syntax when reading documents, but I don’t understand the parameter representation in the syntax. What does it mean to use parameters separated by ‘[,’, as shown below:
[] contains optional parameters, which may or may not be provided. The writing format is like this, first arg1, arg2, then arg2 is an optional parameter, just add square brackets to parameter arg2. That is, arg1[, arg2]
[] contains optional parameters, which may or may not be provided.
The writing format is like this, first arg1, arg2, then arg2 is an optional parameter, just add square brackets to parameter arg2. That is, arg1[, arg2]
Optional parameters
array.forEach(callback)
或者array.forEach(callback, thisArg)
Optional parameters, you can fill them in or not