Test name | Executions per second |
---|---|
lodash | 274.1 Ops/sec |
arr | 256.2 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
var arr = [];
for(var i = 0; i < 100000; i++){
arr.push({value:getRandomInt(100)});
}
_.filter(arr, a => a > 50);
arr.filter(a => a >50);