Jeff Walden wrote:
It's not the most correct way to do it.  |a + ""| performs ToPrimitive(a, hint 
= None), whereas ToString(a) performed ToPrimitive(a, hint = String).  The former 
consults valueOf, then toString, the latter the reverse.

Argh, I had forgotten about the no-hint case there. It seems wrong still, but I forget the details from ES1 era.

Domenic's question of why you want an explicit ToString in the language remains. If there's a strong reason for it, Reflect.toString might be the answer.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to