2021年6月3日

js判断数据类型的四种方法

摘要: 在 ECMAScript 规范中,共定义了 7 种数据类型,分为基本类型和引用类型两大类。 其中: 基本类型:String、Number、Boolean、Symbol、Undefined、Null 引用类型:Object 基本类型也称为简单类型,由于其占据空间固定,是简单的数据段,为了便于提升变量查 阅读全文

posted @ 2021-06-03 22:30 铃之森 阅读(883) 评论(0) 推荐(0) 编辑

JS语法ES6、ES7、ES8、ES9、ES10、ES11、ES12新特性

摘要: ES6(2015) 类(class) class Man { constructor(name) { this.name = '小豪'; } console() { console.log(this.name); } } const man = new Man('小豪'); man.console( 阅读全文

posted @ 2021-06-03 18:07 铃之森 阅读(988) 评论(0) 推荐(1) 编辑

JavaScript中哪一种循环最快

摘要: 究竟哪一种循环更快? 答案其实是: for(倒序) const million = 1000000; const arr = Array(million); // 注:这是稀疏数组,应该为其指定内容,否则不同方式的循环对其的处理方式会不同: // const arr = [...Array(mill 阅读全文

posted @ 2021-06-03 17:09 铃之森 阅读(127) 评论(0) 推荐(0) 编辑

导航