JS and OOP (v2)

Revision 2 of this benchmark created by devu on


Test runner

Ready to run.

Testing in
TestOps/sec
Constructor
function myObject(){  
    this.iAm = 'an object';  
    this.whatAmI = function(){  
        alert('I am ' + this.iAm);  
    };  
}; 
 
ready
Literal
var myObject = {  
    iAm : 'an object',  
    whatAmI : function(){  
        alert('I am ' + this.iAm);  
    }  
} 
ready

Revisions

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