Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
map vs flatMap (fixed)
(version: 1)
Comparing performance of:
map vs flatMap
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var arrayOfArrays = Array(1000).fill().map(el => Array(10).fill(1)); var flattenedArray = arrayOfArrays.flat();
Tests:
map
const map = (array) => { return array.map(i => i) } map(flattenedArray);
flatMap
const flatMap = (array) => { return array.flatMap(i => i); } flatMap(arrayOfArrays);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
map
flatMap
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?