Conditional assignment

Benchmark created on


Setup


Test runner

Ready to run.

Testing in
TestOps/sec
Multiple conditionals
const cond = true
const foo = cond ? 'a' : 'b'
const bar = cond ? 'c' : 'd'
const baz = cond ? 'x' : 'y'
ready
Conditional array assignment
const cond = true
const [foo, bar, baz] = cond ? ['a', 'c', 'x'] : ['b', 'd', 'y']
ready

Revisions

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