toBoolIf

Benchmark created by vjeux on


Preparation HTML

<script>
  function toBoolObject(a){var b={"true":!0,"false":!1};if(a in b)return b[a]}
  function toBoolIf(a){if(a==="true")return!0;if(a==="false")return!1};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Object
toBoolObject('true');
toBoolObject('false');
toBoolObject('null');
ready
If
toBoolIf('true');
toBoolIf('false');
toBoolIf('null');
ready

Revisions

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