Lodash flatten vs Array.flat

Benchmark created on


Description

Simple embedded script benchmark. Imports the Lodash library with

Preparation HTML

<script src="https://cdn.jsdelivr.net/npm/lodash-es@4.17.21/lodash.min.js"></script>

Setup

const arr = [0, 1, 2, [3, 4]];

Test runner

Ready to run.

Testing in
TestOps/sec
_.flatten
_.flatten(arr);
ready
Array.flat
arr.flat();
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.