String literal vs Object (v2)

Revision 2 of this benchmark created on


Description

Question exists here on Stack Overflow.

Test runner

Ready to run.

Testing in
TestOps/sec
String Literal
var s = '0123456789';
l = s.length;
for (var i = 0; i < l; i++) {
  s.charAt(i);
}
ready
String Object
var s = new String('0123456789');
l = s.length;
for (var i = 0; i < l; i++) {
  s.charAt(i);
}
ready
In place call
var l = '0123456789'.length;
for (var i = 0; i < l; i++) {
  '0123456789'.charAt(i);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.