I\'ve experimented with JavaScript and noticed this strange thing:
var s = \"hello world!\"; s.x = 5; console.log(s.x); //undefined
Every t
String objects are objects and can be expanded, but string literals are not string objects and can not be expanded.
Example:
var s = 'asdf'; s.x = 42; alert(s.x); // shows "undefined" s = new String('asdf'); s.x = 1337; alert(s.x); // shows "1337"