Set.prototype.add

Adds an item to the set.

Syntax

add(item)

Parameters

Return value

The same set.

Examples

let set = new Set()
set.add("hello")
set.has("hello")
true