JsSet

class JsSet[A]() extends JsIterable[A]

Set objects are collections of unique values. You can iterate through the elements of a set in insertion order. A value in the Set may only occur once; it is unique in the Set's collection. Sets are mutable, like everything in JS

Note that Javascript === equality semantics apply. JsSet does not know anything about Scala equals method or the case classes structural equality.

The Map object holds key-value pairs and remembers the original insertion order of the keys. Any value (both objects and primitive values) may be used as either a key or a value. The Map is mutable, like everything in JS.

See also:
Companion:
object
trait JsIterable[A]
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Constructors

def this(iterable: JsIterable[A])

!! Passing iterable is not supported by IE - populate the Map separately if needed.

!! Passing iterable is not supported by IE - populate the Map separately if needed.

Concrete methods

def add(value: A): JsSet[A]

!! Not fully supported by IE - returns js.undefined instead of Set

!! Not fully supported by IE - returns js.undefined instead of Set

Implicitly added by RichJsSet
def asScalaJs: Set[A]
Implicitly added by RichJsSet
def clear(): Unit

!! Not supported by IE !!

!! Not supported by IE !!

def delete(value: A): Boolean
def forEach(f: Function1[A, Unit]): Unit

Note: this might be a bit slower than Scala.js js.Set.foreach implementation in some browsers, however the native JS method works in IE 11, whereas the Scala.js implementation uses JS iterables, which are not supported in any IE version.

Note: this might be a bit slower than Scala.js js.Set.foreach implementation in some browsers, however the native JS method works in IE 11, whereas the Scala.js implementation uses JS iterables, which are not supported in any IE version.

def has(value: A): Boolean
def keys(): JsIterable[A] & Iterator[A]

Alias for values.

Alias for values.

!! Not supported by IE !!

def size: Int
def values(): JsIterable[A] & Iterator[A]

!! Not supported by IE !!

!! Not supported by IE !!

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def iterator(): Iterator[A]

!! Not supported by IE !!

!! Not supported by IE !!

Inherited from:
JsIterable
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

val set: JsSet[A]
Implicitly added by RichJsSet