String literal vs Object

Benchmark created by Sheikh Heera on


Test runner

Ready to run.

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

Revisions

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