Readonly
lengthAdds all arguments passed, except those already present.
Throws a "SyntaxError" DOMException if one of the arguments is the empty string.
Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.
Rest
...tokens: string[]Optional
thisArg: anyRemoves arguments passed, if they are present.
Throws a "SyntaxError" DOMException if one of the arguments is the empty string.
Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.
Rest
...tokens: string[]Replaces token with newToken.
Returns true if token was replaced with newToken, and false otherwise.
Throws a "SyntaxError" DOMException if one of the arguments is the empty string.
Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace.
If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()).
Returns true if token is now present, and false otherwise.
Throws a "SyntaxError" DOMException if token is empty.
Throws an "InvalidCharacterError" DOMException if token contains any spaces.
Optional
force: boolean
Returns the number of tokens.
MDN Reference