What do the brackets around the arguments mean when reading documentation for a method?

api, javascript

Solution

`required` `[optional]` `<required>` `[<optional>, <but both needed>]`.

This is almost always the case.

Problem

Often when reading documentation on what arguments can be passed to a method, I see brackets used within the arguments list like this: What do the brackets mean in this context? Why are the commas inside the brackets?

Original source

Related problems