Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Lodash Flatten vs Array.flat()
lodash flatten vs spread
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:121.0) Gecko/20100101 Firefox/121.0
Browser:
Firefox 121
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
lodash flatten
255K/s
array flat
247K/s
View exact numbers
Test name
Executions per second
✓
lodash flatten
255,259 Ops/sec
array flat
246,716 Ops/sec
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Tests:
array flat
const arrayA = ['hi', 'hi', 'hi', 'hi']; const arrayB = ['hi', 'hi', 'hi', 'hi']; const flattened = [ arrayA, arrayB ].flat(); console.log(flattened);
lodash flatten
const arrayA = ['hi', 'hi', 'hi', 'hi']; const arrayB = ['hi', 'hi', 'hi', 'hi']; const flattened = _.flatten([arrayA, arrayB]); console.log(flattened);