SymbolConstructor

@native @JSType trait SymbolConstructor extends StObject
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def `for`(key: String): Symbol

Returns a Symbol object from the global symbol registry matching the given key if found. Otherwise, returns a new symbol with this key.

Returns a Symbol object from the global symbol registry matching the given key if found. Otherwise, returns a new symbol with this key.

Value Params
key

key to search for.

def apply(): Symbol

Returns a new unique Symbol value.

Returns a new unique Symbol value.

Value Params
description

Description of the new Symbol object.

def apply(description: String): Symbol
def apply(description: Double): Symbol
def keyFor(sym: Symbol): UndefOr[String]

Returns a key from the global symbol registry matching the given Symbol if found. Otherwise, returns a undefined.

Returns a key from the global symbol registry matching the given Symbol if found. Otherwise, returns a undefined.

Value Params
sym

Symbol to find the key for.

Inherited methods

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

Concrete fields

val `match`: Symbol

A regular expression method that matches the regular expression against a string. Called by the String.prototype.match method.

A regular expression method that matches the regular expression against a string. Called by the String.prototype.match method.

val asyncIterator: Symbol

A method that returns the default async iterator for an object. Called by the semantics of the for-await-of statement.

A method that returns the default async iterator for an object. Called by the semantics of the for-await-of statement.

val hasInstance: Symbol

A method that determines if a constructor object recognizes an object as one of the constructor’s instances. Called by the semantics of the instanceof operator.

A method that determines if a constructor object recognizes an object as one of the constructor’s instances. Called by the semantics of the instanceof operator.

val isConcatSpreadable: Symbol

A Boolean value that if true indicates that an object should flatten to its array elements by Array.prototype.concat.

A Boolean value that if true indicates that an object should flatten to its array elements by Array.prototype.concat.

val iterator: Symbol

A method that returns the default iterator for an object. Called by the semantics of the for-of statement.

A method that returns the default iterator for an object. Called by the semantics of the for-of statement.

val matchAll: Symbol

A regular expression method that matches the regular expression against a string. Called by the String.prototype.matchAll method.

A regular expression method that matches the regular expression against a string. Called by the String.prototype.matchAll method.

val replace: Symbol

A regular expression method that replaces matched substrings of a string. Called by the String.prototype.replace method.

A regular expression method that replaces matched substrings of a string. Called by the String.prototype.replace method.

val search: Symbol

A regular expression method that returns the index within a string that matches the regular expression. Called by the String.prototype.search method.

A regular expression method that returns the index within a string that matches the regular expression. Called by the String.prototype.search method.

val species: Symbol

A function valued property that is the constructor function that is used to create derived objects.

A function valued property that is the constructor function that is used to create derived objects.

val split: Symbol

A regular expression method that splits a string at the indices that match the regular expression. Called by the String.prototype.split method.

A regular expression method that splits a string at the indices that match the regular expression. Called by the String.prototype.split method.

val toPrimitive: Symbol

A method that converts an object to a corresponding primitive value. Called by the ToPrimitive abstract operation.

A method that converts an object to a corresponding primitive value. Called by the ToPrimitive abstract operation.

val toStringTag: Symbol

A String value that is used in the creation of the default string description of an object. Called by the built-in method Object.prototype.toString.

A String value that is used in the creation of the default string description of an object. Called by the built-in method Object.prototype.toString.

val unscopables: Symbol

An Object whose own property names are property names that are excluded from the 'with' environment bindings of the associated objects.

An Object whose own property names are property names that are excluded from the 'with' environment bindings of the associated objects.