String(symbol)

Brendan Eich brendan at mozilla.org
Tue Aug 26 09:28:11 PDT 2014


Brendan Eich wrote:
> Use +'' if you want ToString in the language, I say.

asm.js points the way on other explicit conversion forms:

ToString(x) is x+''
ToNumber(x) is +x
ToInt32(x) is ~~x
ToBoolean(x) is !!x

/be


More information about the es-discuss mailing list