1

in the MDN documentation i have seen it many times for example

p.then(onFulfilled[, onRejected]);

this method takes two functions callbacks that I understand but why in the syntax example provided by MDN there is brackets like its an array and to add to my confusion there is a comma in the beginning or maybe this doesn't mean an array at all and means something else i know it might be something really small or trivial but i cant find relative information regarding this thank you so much for helping

mido
  • 29
  • 4
  • 5
    That's a documentation syntax, brackets mean that the parameter is optional. – Teemu Feb 21 '22 at 12:30
  • You see it in lots of other contexts, too: https://stackoverflow.com/q/1718903/3001761, https://stackoverflow.com/q/21654192/3001761 – jonrsharpe Feb 21 '22 at 12:32
  • 1
    You can find more info in the MDN [document structure docs](https://developer.mozilla.org/en-US/docs/MDN/Structures/Syntax_sections#formal_syntax) – Nick Parsons Feb 21 '22 at 12:39

0 Answers0