Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Chrome 53
Mac OS X 10.12.0
Other
8 years ago
Test name Executions per second
emptyFunc 9748755.0 Ops/sec
trueFunc 9852318.0 Ops/sec
undefinedFunc 3426315.8 Ops/sec
nullFunc 10036241.0 Ops/sec
Script Preparation code:
AخA
 
var emptyFunc = function() {};
var trueFunc = function() { return true; }
var undefinedFunc = function() { return undefined; }
var nullFunc = function() { return null; }
Tests:
  • emptyFunc

     
    emptyFunc();
  • trueFunc

     
    trueFunc();
  • undefinedFunc

     
    undefinedFunc();
  • nullFunc

     
    nullFunc();