Boolean vs !!

Benchmark created on


Setup

let myObject = {};

Test runner

Ready to run.

Testing in
TestOps/sec
Boolean() Cast
const result = Boolean(myObject.property)


if (result) {
	// noop
}
ready
Double Negation
const result = !!myObject.property


if (result) {
	// noop
}
ready

Revisions

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