Optional chaining

Benchmark created on


Setup

const obj = { a: { b: { c: 'hello world' } } };

Test runner

Ready to run.

Testing in
TestOps/sec
Without optional chaining
console.log(obj.a.b.c);
ready
With (redundant) optional chaining
console.log(obj?.a?.b?.c);
ready

Revisions

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