Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Spread Vs Destructure vs naiive in variable assignment
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
Spread
216931312.0 Ops/sec
Destructure
213652704.0 Ops/sec
Naiive
198673744.0 Ops/sec
Script Preparation code:
var input = [1, 2, 3];
Tests:
Spread
const [a, b, c] = input;
Destructure
const {0: a, 1: b, 2: c} = input;
Naiive
const a = input[0]; const b = input[1]; const c = input[2];