Created
November 30, 2009 10:08
-
-
Save jakearchibald/245379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(obj) { | |
| if (obj.constructor.name) { | |
| return obj.constructor.name; | |
| } else { | |
| var constructorStr = obj.constructor.toString(); | |
| return constructorStr.slice( constructorStr.indexOf('function ') + 9, constructorStr.indexOf('(') ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment