You can use toString to get the string representation of an object or other primitive, but I don't think there's a toObject method. unfortunately.
However, it seems you can do this:
d8> a = new String("foo") foo d8> a foo d8> typeof a object d8>
- Maxime
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_______________________________________________ Tachyon-list mailing list Tachyon-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/tachyon-list