inArray vs "in object"

Benchmark created by Andre Farzat on


Description

Testing jquery.inArray vs "in object"

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

Setup

window.array = ['one', 'two', 'three'];
    window.object = { 'one' : '', 'two': '', "three": '' };

Test runner

Ready to run.

Testing in
TestOps/sec
jquery.inArray
var value = jQuery.inArray('three', array);
ready
in object
var value = 'three' in object;
ready

Revisions

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