ES6 vs Lodash range
Date tested:
one month ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Test name
Executions per second
ES6 Array.from
4407540.5 Ops/sec
Lodash rrange
38324372.0 Ops/sec
Benchmark definition (click to collapse):
HTML Preparation code:
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.20/lodash.min.js"></script>
Tests:
ES6 Array.from
const a = Array.from( { length: 6 - 2 + 1 }, (_, ndx) => ndx + 2 )
Lodash rrange
const a = _.range(2, 6+1)
Open this result on MeasureThat.net