jskatas.org Continuously Learn JavaScript. Your Way.

Set: the API

Set API overview.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

Set API overview

  • a Set can be created from an array
  • size is the number of values
  • add() appends the given value
  • clear() removes all elements
  • delete() removes the given value
  • entries() returns an iterator for all values
  • forEach() calls a callback for each value
  • has() returns true if the given value is in the set

returns an iterator that contains all values

  • keys()
  • values()
  • [Symbol.iterator]()


Announcement of this kata on twitter.