Preparation Code Preparation HTML (this will be inserted in the <body>
of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script src ="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" > </script >
<script src ="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.underscore.min.js" > </script >
<script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js" > </script >
<script >
if (!Array .prototype .forEach ) {
Array .prototype .forEach = function forEach (callback, thisArg ) {
'use strict' ;
var T, k;
if (this == null ) {
throw new TypeError ("this is null or not defined" );
}
var kValue,
O = Object (this ),
len = O.length >>> 0 ;
if ({}.toString .call (callback) !== "[object Function]" ) {
throw new TypeError (callback + " is not a function" );
}
if (arguments .length >= 2 ) {
T = thisArg;
}
k = 0 ;
while (k < len) {
if (k in O) {
kValue = O[k];
callback.call (T, kValue, k, O);
}
k++;
}
};
}
</script >
Setup JS
Teardown JS
Test cases
Test #1 Title *
Async
Code * var testArray = Array .apply (null , {length : 5000 }).map (Function .call , Math .random );
angular.forEach (testArray, function (value, index ) {
});
Test #2 Title *
Async
Code * var testArray = Array .apply (null , {length : 5000 }).map (Function .call , Math .random );
jQuery.each (testArray, function (index, value ) {
});
Title *
Async
Code * var testArray = Array .apply (null , {length : 5000 }).map (Function .call , Math .random );
_.forEach (function (index, value ) {
});