Assignment array destructuring vs indexing

Benchmark created on


Setup

const input = [0,1,2,3,4,5,6,7,8,9];

Test runner

Ready to run.

Testing in
TestOps/sec
Destructuring
const [a,b,c,d,e,f,g,h,i,j] = input;
ready
Indexing
const a = input[0],
b = input[1],
c = input[2],
d = input[3],
e = input[4],
f = input[5],
g = input[6],
h = input[7],
i = input[8],
j = input[9];
ready

Revisions

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