Permalink
Browse files

Add experimental `isBoundFunction`.

  • Loading branch information...
1 parent 4babcab commit 047f3a4358f6f97bc9ec8e3383fcb5df1efeada5 @kangax committed Aug 30, 2010
Showing with 17 additions and 0 deletions.
  1. +17 −0 isBoundFunction.js
View
@@ -0,0 +1,17 @@
+function isBoundFunction(obj) {
+ return typeof obj == 'function' && !Object.hasOwnProperty.call(obj, 'prototype');
+}
+
+/*
+
+var f = function(){ return this; };
+var objToBind = { };
+
+var bound = f.bind(objToBind);
+
+isBoundFunction(f); // false
+isBoundFunction(bound); // true
+
+isBoundFunction({ }); // false
+
+*/

0 comments on commit 047f3a4

Please sign in to comment.