Skip to main content
Version: 3.14.1

Set.prototype.add()

The add() method inserts a new element with a specified value in to a Set object, if there isn't an element with the same value already in the Set.

Syntax

add(value)

Parameters

  • value
    • : The value of the element to add to the Set object.

Return value

The Set object with added value.