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:
PHP中文网2017-05-24 11:40:27
[] 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]
世界只因有你2017-05-24 11:40:27
Optional parameters
array.forEach(callback)
或者 array.forEach(callback, thisArg)