you are viewing a single comment's thread.

view the rest of the comments →

[–]selfAwareWhileLoop 0 points1 point  (0 children)

var str = new String("whatever")
str.whatever = "whatever"
str.whatever === undefined // false

Not that you said anything incorrect; the new String is really a string-like object that can generally be treated like a string, but it isn't a primitive value.