it is cheap

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var a = {},
        b = [],
        toString = Object.prototype.toString,
    objProto = Object.prototype;
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
is array
toString.call([]) === "[object Array]"
pending…
is object
toString.call({}) === "[object Object]"
pending…
array is array
Array.isArray([]) === true
pending…
object check
({}).__proto__ === objProto;
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment