/ Published in: JavaScript

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Object.toType = (function toType(global) { return function(obj) { if (obj === global) { return "global"; } return ({}).toString.call(obj).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); } })(this)
Comments
