<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Comments on snippet: 'type.of() - a more specific typeof()'</title>
<link>http://snipplr.com</link>
<description>Snipplr comments feed'</description>
<language>en-us</language>
<pubDate>Tue, 14 Feb 2012 07:50:24 GMT</pubDate>
<item>
<title>CDRates said on 2/8/10</title>
<link>http://snipplr.com/view/1996/typeof--a-more-specific-typeof/</link>
<description><![CDATA[ Great bit of code! ]]></description>
<pubDate>Mon, 08 Feb 2010 13:01:04 GMT</pubDate>
<guid>http://snipplr.com/view/1996/typeof--a-more-specific-typeof/</guid>
</item>
<item>
<title>jameswatts said on 8/3/09</title>
<link>http://snipplr.com/view/1996/typeof--a-more-specific-typeof/</link>
<description><![CDATA[ var type = {
  of: function(obj) {
    var type = typeof(obj);
    if(type == 'object') {
      if(obj == null) {
        return 'null';
      }
      else if(obj.constructor.toString().match(/regexp/i) != null) {
        return 'regexp';
      }
      else if(obj.constructor.toString().match(/date/i) != null) {
        return 'date';
      }
      else if(obj.constructor.toString().match(/html/i) != null) {
        return 'html';
      }
      else if(obj.constructor.toString().match(/array/i) != null &amp;&amp; typeof(obj.length) != 'undefined') {
        return 'array';
      } else {
        return 'object';
      }
    } else {
      return type;
    }
  }
}; ]]></description>
<pubDate>Mon, 03 Aug 2009 18:21:18 GMT</pubDate>
<guid>http://snipplr.com/view/1996/typeof--a-more-specific-typeof/</guid>
</item>
</channel>
</rss>
