Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array(n).fill(char) vs Array.from({ length: n }, _ => char)
(version: 1)
Comparing performance of:
Array(n).fill(str) vs Array.from({ length: n }, _ => str)
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var str = "string"; var n = 1000;
Tests:
Array(n).fill(str)
var res = Array(n).fill(str)
Array.from({ length: n }, _ => str)
var res = Array.from({ length: n }, _ => str)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array(n).fill(str)
Array.from({ length: n }, _ => str)
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?