SwVitaliy

Untitled

May 2nd, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. funNameBF = function(cx, fn) {
  2. var i; for(i in cx ) {
  3. if ( cx[i] === fn ) {
  4. return i;
  5. }
  6. }
  7. return undefined;
  8. }
  9.  
  10. AAA = {
  11. fff: function() { console.log( funNameBF(this, arguments.callee) ) }
  12. }
  13. >Object
  14. AAA.fff()
  15. >fff
  16. >undefined
Advertisement
Add Comment
Please, Sign In to add comment