Array methods applied to strings

James Graham jgraham at opera.com
Mon May 11 05:16:27 PDT 2009


It seems that ES5 throws a TypeError for constructs like

Array.prototype.pop.call("abc")

whereas current implementations (and, I think ES3, but I didn't check 
that closely) will return "c".

Is this change intentional? There seems to be a note in the 
compatibility appendix that is about a similar, but not quite identical 
issue (or maybe it is identical and I have misunderstood). Are there 
grounds to be confident that the old behavior is not needed for web 
compatibility?

Apologies if I have overlooked something or misunderstood something.


More information about the es-discuss mailing list