Published
Edited
May 19, 2021
Insert cell
Insert cell
function coercing(b) {
const x = Array.from({ length: b.iterations / 1000 }).map(
(d) => "" + Math.random()
);

b.tic(); // start timing

for (let i = 0; i < b.iterations; i++) {
const v = x[i & 0x3ff];
v == null;
}

b.toc(); // end timing

b.end(); // finish the benchmark
}
Insert cell
function equality(b) {
const x = Array.from({ length: b.iterations / 1000 }).map(
(d) => "" + Math.random()
);

b.tic(); // start timing

for (let i = 0; i < b.iterations; i++) {
const v = x[i & 0x3ff];
v === null || v === undefined;
}

b.toc(); // end timing

b.end(); // finish the benchmark
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more