Destructuring vs Dot Notation

Benchmark published by System on

Description

Accessing object properties.

Setup

const obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };

Test Runner

Initializing...

Testing in
Test CaseOps/sec
Destructuring
const { a, b, c, d, e } = obj;
ready
Dot notation
const a = obj.a, b = obj.b, c = obj.c, d = obj.d, e = obj.e;
ready

Revisions

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

Revision 1
publishedby Systemon