The Javascript Set add()
method appends a new element to a Set object.
It returns the Set object.
mySet.add(value);
Using the add method
var mySet = new Set(); mySet.add(1);//from w ww . java 2 s. c o m mySet.add('one'); mySet.add(1); mySet.add(5).add('some text'); // chainable console.log(mySet);