Home  >  Q&A  >  body text

javascript - Regarding some document syntax expressions '[,'

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:

滿天的星座滿天的星座2723 days ago828

reply all(3)I'll reply

  • PHP中文网

    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]

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-24 11:40:27

    Optional parameters

    array.forEach(callback) 或者 array.forEach(callback, thisArg)

    reply
    0
  • ringa_lee

    ringa_lee2017-05-24 11:40:27

    Optional parameters, you can fill them in or not

    reply
    0
  • Cancelreply