判断字符串、数组

 function type(obj){
          return Object.prototype.toString.call(obj).slice(8,-1)
      }
原文地址:https://www.cnblogs.com/shiyunfront/p/10437964.html