Standard built-ins
Set.prototype.add()
Insert a member if not already present; return receiver.
Formal Syntax & Structure
javascript syntaxjavascript
set.add(value)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | Any | Value to associate or insert. |
Return Value
Set
Same set.
Working Example
Example Snippetjavascript
const s=new Set();console.log(s.add(3)===s);