Truthy check - boolean vs string vs int

Benchmark created by Eric on


Test runner

Ready to run.

Testing in
TestOps/sec
Boolean - truthy
if (true) {}
ready
Boolean - falsey
if (false) {}
ready
String - truthy
if ('text') {}
ready
String - falsey
if ('') {}
ready
Int - truthy
if (1) {}
ready
Int - falsey
if (0) {}
ready

Revisions

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