W3cubDocs

/Haxe JavaScript

Symbol

package js.lib

Available on js

Static variables

staticread onlyasyncIterator:Symbol

A method that returns the default AsyncIterator for an object.

staticread onlyiterator:Symbol

A method returning the default iterator for an object.

Static methods

staticfor_(key:String):Symbol

Searches for existing symbols with the given key and returns it if found. Otherwise a new symbol gets created in the global symbol registry with this key.

statickeyFor(sym:Symbol):Null<String>

Retrieves a shared symbol key from the global symbol registry for the given symbol.

Constructor

new(?description:String)

To create a new primitive symbol, use new Symbol() with an optional string as its description.

NOTE: Unlike in plain JavaScript, new Symbol() syntax is used in Haxe. This generates a Symbol(...) expression as required by the JavaScript specification.

Methods

inlineofObject<T>(object:{}):Null<T>

Retrieve symbol from a given object.

NOTE: This is a Haxe-specific method that generates an object[symbol] expression.

toString():String

Returns a string containing the description of the Symbol.

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/lib/Symbol.html