JS and OOP (v10)

Revision 10 of this benchmark created 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);
  };
};

var obj = new myObject();
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.