empty function vs. nothing

Benchmark created on


Preparation HTML

<script>
  var callbacks = {};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
empty function
(callbacks.success ||
function() {})();
ready
nothing - if clause
if (callbacks.success) callbacks.success();
ready
nothing - in operator
'success' in callbacks && callbacks.success();
ready

Revisions

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