Object Instantiation

JavaScript performance comparison

Test case created by Josh Rhoades

Info

Quick check to see if there is any noticeable difference between how objects are instantiated.

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Classic Object
var oOne = {
    'one': true,
    'two': 'three',
    'three': [1,2,3,4,5,6,7,8,9,0]
};
pending…
Bracket Object
var oTwo = {};
oTwo['one'] = true;
oTwo['two'] = 'three';
oTwo['three'] = [1,2,3,4,5,6,7,8,9,0];
pending…
Dot Object
var oThree = {};
oThree.one = true;
oThree.two = 'three';
oThree.three = [1,2,3,4,5,6,7,8,9,0];
pending…

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

Compare results of other browsers

0 comments

Add a comment