I am constructing a string by concatenating the first 100 unicode characters, like this
var str = "";
for (var i = 0; i < 100; i++) {
str += String.fromCharCode(i);
}
In Firefox and Chrome, str has the value I expected, i.e.
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abc
Internet Explorer and Opera, on the other hand, return the empty string.
You can test it out in your browser on jsFiddle.
What is causing this discrepancy in behavior?
The first Unicode codepoint represents the NUL character, which probably makes some browsers think they reached end of string (following the C convention).