Dez nulls

Benchmark created on


Setup

const array1 = [];
const array2 = null;

Test runner

Ready to run.

Testing in
TestOps/sec
nullish
const result1 = array1 ?? [];
const result2 = array2 ?? [];
ready
falsey or
const result1 = array1 || [];
const result2 = array2 || [];
ready
terniary
const result1 = array1 ? array1 : [];
const result2 = array2 ? array2 : [];
ready

Revisions

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