FOR LOOPS test (v24)

Revision 24 of this benchmark created on


Description

Difference between for/in, classical for loop and classical loop with caching.

Preparation HTML

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

Setup

var myArray = ['a', 'b', 'c', 'd'];

Test runner

Ready to run.

Testing in
TestOps/sec
do ... while (i--)
var i = myArray.length - 1
do {} while (i--)
ready
for loop (no caching)
for (var i = 0; i < myArray.length; i++) {}
ready
for loop (with caching)
for (var i = 0, l = myArray.length; i < l; i++) {}
ready
do ... while (--i)
var i = myArray.length
do {} while (--i)
ready

Revisions

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