toString.call vs typeof

Edit on GitHub

typeof vs tostring.call

Setup

var fn = function() { return true; }

Tests

  • toString.call

    return toString.call(fn);
  • typeof

    return typeof fn === 'function'