/**
 * 类型检测函数
 * 为typeof关键字的增强版,可以准确判断null,date类型
 * 原理是使用V8引擎最初的toString方法观察数据类型
 * @author 不爱喝橙子汁
 * @version 1.0.0
 * @param {Object} obj 任意对象,例如null,undefined,date
 * @return {String} 类型的全小写字符串
 */
function type(obj) {
   return Object.prototype.toString.call(obj).slice(8,-1).toLowerCase(); 
}

GWO