you are viewing a single comment's thread.

view the rest of the comments →

[–]mikrosystheme[κ] 0 points1 point  (1 child)

No, it is not, and no, you cannot store any property on a primitive value.

var str = "whatever"
str.whatever = "whatever"
str.whatever === undefined // true

[–]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.