Brendan Eich (2014-08-26T16:28:11.000Z)
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
domenic at domenicdenicola.com (2014-09-08T23:26:31.810Z)
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`