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

为什么有些网站看不到百度快照wordpress右下角添加欢迎弹窗

为什么有些网站看不到百度快照,wordpress右下角添加欢迎弹窗,十堰市建设网站的公司,百度小程序登录入口js中经常用到数据类型检查#xff0c;常用的类型检查方法有typeof、instanceof、constructor、Object.prototype.toString.call等#xff0c;现在逐一介绍一下。 js中数据类型总体上分为二大类#xff1a;基本类型(原始数据类型)和引用类型#xff0c;其中 基本类型又分为…js中经常用到数据类型检查常用的类型检查方法有typeof、instanceof、constructor、Object.prototype.toString.call等现在逐一介绍一下。 js中数据类型总体上分为二大类基本类型(原始数据类型)和引用类型其中 基本类型又分为常用的 string、number、boolean、null、undefined、symbol、BigInt这些类型 引用类型是除去基本类型外的比如常用的Array、Object这些 一、typeof 1. 使用typeof判断基本类型 const str testme typeof str // stringconst num 123 typeof num // numberconst bol true typeof bol // booleanconst nu null type nu // objecttypeof undefVar // undefinedconst sy Symbol(a) typeof sy // symbolconst bi BigInt(12345678910111213) typeof bi // bigint2. 使用typeof判断引用类型const arr [1,5,7] typeof arr // objectconst obj {a:3} typeof obj // objectfunction Man(name,age) {this.name namethis.age age } typeof Man // functionconst man new Man(Lily, 12) typeof man // object 二、instanceof 使用方法:  A instanceof B 主要是确认B.prototype属性是否在A的原型链上如果一直顺着原型链找到Object.prototype还是没找到结果就返回false。主要用来判断引用数据类型的 const arr [1,5,7] arr instanceof Array // trueconst obj {a:3} obj instanceof Object // trueobj instanceof Array // falsefunction Man(name,age) {this.name namethis.age age }Man instanceof Function // trueconst man new Man(Lily, 12) man instanceof Object // true 三、constructor A.constructor主要可以返回A对应的构造函数 const str testme str.constructor String // trueconst num 123 num.constructor Number // trueconst bol true bol.constructor Boolean // trueconst arr [1,5,7] arr.constructor Array // trueconst obj {a:3} obj.constructor Object // truefunction Man(name,age) {this.name namethis.age age }Man.constructor Function // trueconst man new Man(Lily, 12) man.constructor Man // true但是像 null、undefined这种就调用不了constructor判断数据类型了 四、Object.prototype.toString.call Object.prototype.toString.call方法返回各数据类型的[object xxx]形式 const str testme Object.prototype.toString.call(str) // [object String]const num 123 Object.prototype.toString.call(num) // [object Number]const bol true Object.prototype.toString.call(bol) // [object Boolean]const sy Symbol(a) Object.prototype.toString.call(sy) // [object Symbol]const bi BigInt(12345678910111213) Object.prototype.toString.call(bi) // [object BigInt]Object.prototype.toString.call(null) // [object Null]Object.prototype.toString.call(undefined) // [object Undefined]const arr [1,5,7] Object.prototype.toString.call(arr) // [object Array]const obj {a:3} Object.prototype.toString.call(obj) // [object Object]function Man(name,age) {this.name namethis.age age }Object.prototype.toString.call(Man) // [object Function]const man new Man(Lily, 12) Object.prototype.toString.call(man) // [object Object] 可以看出Object.prototype.toString.call方法判断的数据类型更广。 去掉Object.prototype.toString.call方法返回结果中的[object只保留具体类型 function getType(data) {return Object.prototype.toString.call(data).replace(/\[object\s(.)\]/, $1 ).toLowerCase() }const str testme getType(str) // stringconst num 123 getType(num) // numberconst bol true getType(bol) // booleanconst sy Symbol(a) getType(sy) //symbolconst bi BigInt(12345678910111213) getType(bi) // bigIntgetType(null) // nullgetType(undefined) // undefinedconst arr [1,5,7] getType(arr) // arrayconst obj {a:3} getType(obj) // objectfunction Man(name,age) {this.name namethis.age age }getType(Man) // functionconst man new Man(Lily, 12) getType(man) // object
http://www.huolong8.cn/news/430942/

相关文章:

  • 优化网站 主题icp备案需要先建设网站么
  • wordpress短代码显示成都百度推广优化
  • 怎么套模板 网站做淘宝门头的网站
  • 网站开发行业资讯夜夜夜在线观看
  • 北京网站制作招聘建设部网站公民服务
  • 网站营销定义项目拉新平台
  • 牡丹江市建设工程交易中心网站网站域名使用费
  • 外贸公司 如何做公司网站全国信用企业公示平台官网
  • 用手机怎么做网站附近的网站电脑培训班
  • 苏州网站建设开发公司wordpress完全静态化
  • 响水企业做网站多少钱自己怎么申请免费网站
  • 找代做海报的网站百度在线使用网页版
  • 会计题库网站怎么做娶妻为什么不娶外贸女
  • 医院网站制作公司网站服务设计
  • 网站建设与管理就业岗位 方向甘肃省省建设厅网站
  • qq空间做淘宝客网站百度推广营销中心
  • 徐州做网站织梦做的网站首页幻灯片怎么不能显示
  • 用什么软件做商务网站南召微网站建设
  • 宁波企业网站建站中国铁建网站
  • 青浦区网站建设公司做美食网站视频下载
  • 深圳设计网站排行安徽网站设计找哪家
  • 建筑企业网站源码wordpress二次元简约主题
  • 南昌网站改版公司泰安集团网站建设方案
  • c 做彩票网站昆明市环保局建设网站
  • 在虚拟机中如何做二级域名网站网站结构怎么做
  • 做招聘求职网站设计资源网站大推荐
  • 南京和筑建设有限公司网站赛事竞猜网站开发
  • 建设一个班级网站的具体步骤jsp网站建设期末作业
  • 现代化的中国风网站快速搭建论坛
  • xp怎么做网站服务器长沙seo外包行者seo07