I have switched to Google’s Chrome as my default browser and today was playing around with the Javascript benchmark tests.
Just wow.
Chrome (2.0.172.39) – 2965
Firefox (3.5.2) – 284
IE (8.0.6001.18702) – 58.1
Good grief.
I have switched to Google’s Chrome as my default browser and today was playing around with the Javascript benchmark tests.
Just wow.
Chrome (2.0.172.39) – 2965
Firefox (3.5.2) – 284
IE (8.0.6001.18702) – 58.1
Good grief.
I spent way too much time figuring this out.
var originalString = “Batman And Robin”;
var replacedSpaces = originalString.replace(‘ ‘, ‘_’);
This doesn’t work, it only replaces the first instace of the match, so replacedSpaces == “Batman_And Robin”.
var replacedSpaces = originalString.replace(/ /g, ‘_’);
This does work, and now replacedSpaces == “Batman_And_Robin”.