Are there any significant reasons for using
typeof variable === \'function\'
versus
!!variable.call
for d
Check the assumptions in the post (see Gumbo's comment).
typeof /regex/ === 'function'
This returns false in Firefox 3.6.13.
Just for amusement, Firefox 3.6.13:
typeof /regex/ // "object"
/regex/ instanceof RegExp // true
/regex/.constructor.name // RegExp
(function () {}).constructor.name // Function
IE8:
typeof /regex/ // "object"
/regex/ instanceof RegExp // true
/regex/.constructor.name // undefined
(function () {}).constructor.name // undefined
Chrome 9:
typeof /regex/ // "function"
/regex/ instanceof RegExp // true
/regex/.constructor.name // "RegExp"
(function () {}).constructor.name // "Function"