JavaScript performance comparison Revision 37 of this test case created by on 2012-7-14 Preparation code <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"> </script> <script> Benchmark.prototype.setup = function() { var i, value, length, values = [], sum = 0, context = values; for (i = 0; i < 10000; i++) { values[i] = Math.random(); } function add(val) { sum += val; } }; B