当前位置: 首页 > news >正文

做外贸建网站公司建网站多少钱

做外贸建网站,公司建网站多少钱,男人和女人晚上做污污的视频大网站,自建网站步骤很多人看到标题就会想到使用typeof运算符#xff0c;但是实际上有些它判断不了 var a [1,2,3] console.log(typeof a) // object//总结#xff1a; typeof运算符并不能直接判断一个变量是对象还是数组#xff0c; //实际上#xff0c;typeof运算符在判断基本…很多人看到标题就会想到使用typeof运算符但是实际上有些它判断不了 var a [1,2,3] console.log(typeof a) // object//总结 typeof运算符并不能直接判断一个变量是对象还是数组 //实际上typeof运算符在判断基本数据类型可以但是引用数据类型就吃力了 判断一个变量是否为数组和对象的方法 instanceof运算符 //基本用法 var a [1,2,3] console.log(a instanceof Array); // true console.log(a instanceof Object); // falsevar b {name:老王,age:18, } console.log(a instanceof Array); // false console.log(a instanceof Object); // true//封装方法 function getDataType(o) {if(o instanceof Array){return Array}else if(o instanceof Object){return Object}else{return param is not object type} } 判断构造函数 var a [1,2,3] console.log(a.__proto__.constructor Array) //true console.log(a.__proto__.constructor Object) //false!--分装方法-- function getDataType(o) {//获取构造函数var constructor o.__proto__.constructor || o.constructorif(constructor Array){return Array}else if(constructor Object){return Object}else{return param is not object type} }!--缺点--早期的ie浏览器不支持__proto__ 这个属性 toString()函数 var a [1, 2, 3]; var b {name: kingx};console.log(Object.prototype.toString.call(a)); // [object Array] console.log(Object.prototype.toString.call(b)); // [object Object]!--其实任何类型的变量在调用toString函数时候都会返回不同的结果-- Object.prototype.toString.call(1); // [object Number] Object.prototype.toString.call(kingx); // [object String] var c; Object.prototype.toString.call(c); // [object Undefined]// 判断变量是数组还是对象 function getDataType(o) {var result Object.prototype.toString.call(o);if (result [object Array]) {return Array;} else if (result [object Object]) {return Object;} else {return param is no object type;} } Array.isArray()函数 在JavaScript 1.8.5 版本中增加的静态函数注意只能判断出是否为数组并不能确定是否为对象 // 下面的函数调用都返回“true” Array.isArray([]); Array.isArray([1]); Array.isArray(new Array()); // 鲜为人知的事实其实 Array.prototype 也是一个数组。 Array.isArray(Array.prototype);// 下面的函数调用都返回“false” Array.isArray(); Array.isArray({}); Array.isArray(null); Array.isArray(undefined); Array.isArray(17); Array.isArray(Array); Array.isArray(true);
http://www.zqtcl.cn/news/315166/

相关文章:

  • 果洛电子商务网站建设多少钱公司网站建设选什么服务器
  • 莱芜做网站公司网站建设表单教案
  • 建设酒类产品网站的好处遵义网站制作费用
  • 高端网站设计价格wordpress登录下载附件
  • 国内有名的网站设计公司wordpress缓存插件比拼
  • 网站的建设和推广直播营销策划方案范文
  • 做购物平台网站 民治百度导航地图下载
  • 东莞市主营网站建设服务机构青岛建站公司电话
  • 做网站技术wordpress漂亮手机网站模板下载
  • 网站怎么更新网页内容网络推广怎么找客户
  • 如何编写网站建设销售的心得适合装饰公司的名字
  • 有什么免费建网站网站pr查询
  • flash+xml网站模板简述网站制作的一般流程
  • 成都私人做网站建设怎么切页面做网站
  • 聊城做网站的公司论坛外链代发
  • 廊坊企业自助建站网站框架设计好后怎么做
  • 手机网站建设效果wordpress 目录改变
  • 做商城网站的项目背景图片c2750服务器做网站行吗
  • 北京市专业网站建设wordpress视频站
  • 知名网站制作公南充建设机械网站
  • 网站建设实践鉴定微商小程序制作
  • 盗用别人网站图做网站快速排名优化推广手机
  • 安徽网站建设服务平台wordpress自定义统计
  • 微网站开发方案模板建站宝盒哪个牌子好
  • 低价做网站网站制作天津
  • 成都网站推广外包门户网站素材
  • wordpress 拿站网站制作北京海淀
  • 惠州网站建设行业wordpress文章阅读权限
  • 做地方网站需要什么部门批准网页版微信二维码
  • o2o网站运维建设方案宿州市网站建设