I was trying to run this line of code and wondering why it is not working. Does anyone has an answer for this?
var string = "foo bar";
string = string.replace(" ", "");
alert(string.length);
why issit that the length of the string is not changed to 6 instead?