instanceofvsmethod

Benchmark created by Shraymonks on


Setup

function X(name){
      this.name = name;
    }
    X.prototype.check = function(name){
    return this.name === name;
    };
    X.getName = function(){
    return this.name;
    }
    var a = new X('asdf');

Test runner

Ready to run.

Testing in
TestOps/sec
instanceof
a instanceof X
ready
check
a.check(X.getName())
ready

Revisions

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

  • Revision 1: published by Shraymonks on