package js.lib
Available on js
The js.Set object lets you store unique values of any type, whether primitive values or object references.
Documentation Set by Mozilla Contributors, licensed under CC-BY-SA 2.5.
new(?iterable:Any)If an iterable object is passed, all of its elements will be added to the new js.Set.
read onlysize:IntThe number of values in the js.Set object.
add(value:T):Set<T>Appends a new element with the given value to the js.Set object. Returns the js.Set object.
clear():VoidRemoves all elements from the js.Set object.
delete(value:T):BoolRemoves the element associated to the value and returns the value that has(value) would have previously returned. has(value) will return false afterwards.
entries():Iterator<KeyValue<T, T>>Returns a new js.lib.Iterator object that contains an array of [value, value] for each element in the js.Set object, in insertion order. This is kept similar to the js.Map object, so that each entry has the same value for its key and value here.
forEach(callback:(value:T, key:T, set:Set<T>) ‑> Void, ?thisArg:Any):VoidCalls callback once for each key-value pair present in the js.Set object, in insertion order.
If a thisArg parameter is provided to forEach, it will be used as the this value for each callback.
has(value:T):BoolReturns a boolean asserting whether an element is present with the given value in the js.Set object or not.
inlineiterator():HaxeIterator<T>inlinekeyValueIterator():SetKeyValueIterator<T>keys():Iterator<T>Returns a new js.lib.Iterator object that contains the keys for each element in the js.Set object in insertion order.
values():Iterator<T>Returns a new js.lib.Iterator object that contains the values for each element in the js.Set object in insertion order.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/lib/Set.html