7

MDN uses:

JSON.stringify(value[, replacer [, space]])

instead of just this:

JSON.stringify(value, replacer, space)

What do the square brackets mean?

Saravana
  • 37,852
  • 18
  • 100
  • 108

1 Answers1

6

It's a conventional way in technical documentation of saying that part is optional.

Itay
  • 16,601
  • 2
  • 51
  • 72
  • Thanks. Are there any other common conventions I should be aware of when reading technical documentations? – Saravana Sep 30 '13 at 08:48
  • Backus-Naur form (BNF) and EBNF are common grammar forms, used to describe the syntax of computer languages. See: http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form – Thomas W Sep 30 '13 at 08:58
  • @Saravana I can't think of other popular conventions on JS documentations right now. Some languages hold more conventions, but as far as I recall `[]` are most commonly used for *optional segments*. – Itay Sep 30 '13 at 09:01