Boolean vs !!

Benchmark created on


Setup

const a = 1
const b = 0
const c = []
const d = [1, 2, 3]

Test runner

Ready to run.

Testing in
TestOps/sec
Boolean
const temp = [
	Boolean(a),
	Boolean(b),
	Boolean(c),
	Boolean(d)
]
ready
!!
const temp = [
  !!a,
  !!b,
  !!c,
  !!d
]
ready

Revisions

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