Using IsCallable Operation?

Mark S. Miller erights at google.com
Fri Jun 5 19:39:19 PDT 2009


On Fri, Jun 5, 2009 at 7:22 PM, Garrett Smith <dhtmlkitchen at gmail.com>wrote:

>
> function isCallable(obj, prop) {
>  var type = typeof obj[prop];
>  if(isNewTypeof) {
>    return type === "function";
>  } else {
>    // fallback "best practice".
>  }
> }
>
>
 function isCallable(obj, prop) {
   var type = typeof obj[prop];
   if (function(){"use strict";return this;}()) {
     // fallback "best practice".
   } else {
     return type === "function";
   }
 }


-- 
   Cheers,
   --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20090605/d03122c6/attachment.html>


More information about the es-discuss mailing list