On 2011-02-01, at 18:48 , chevalma@iro.umontreal.ca wrote:
I don't remember the exact part, but you are correct. Strings in JavaScript are not objects, they're primitives... Except that when you try to use them as objects, the spec says a string object should be created on the spot. The result is that you can do:
a = "abc"; a.foo = 3;
But then a has nothing stored on it, the object used as the field assignment no longer exists after the said assignment... Same for method calls.
That makes it clearer. I imagine I can force the conversion with toObject and toString then?
Bruno