![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ES6新特性
文章平均质量分 81
Katrinasayhello_
平平无奇小辣鸡的学习过程~
展开
-
数组 | Array_API(含手写原理)
总结JavaScript中数组相关API包含手写原理,一起学习吧原创 2022-07-08 16:08:42 · 374 阅读 · 0 评论 -
对象 | Object_API
Object的API众多且重要,按照Object原型方法、进行分类原创 2022-07-08 16:07:08 · 280 阅读 · 1 评论 -
ES6新特性|数组的扩展
1. 拓展运算符…(1)基本用法数组转参数序列(逗号分隔)let arr = [1,2,3];console.log(...arr); // 1 2 3函数调用let arr = [1,2];function add(x,y) { console.log(x+y);};add(...arr); // 3扩展运算符可以放置表达式const arr = [ ...(x>0 ? ['a']:[]), 'b',]如果扩展运算符后面原创 2022-03-04 13:30:09 · 277 阅读 · 0 评论 -
ES6新特性|var let const
let const 是es6提出的新特性,解决了var存在的一些问题1. let const 不存在变量提升变量提升:变量可以在声明之前使用,值为undefinedconsole.log(a); //undefinedvar a = 1; console.log(b); // ReferenceError: Cannot access 'b' before initializationlet b = 1;2. 暂时性死区只要块级作用域内存在let命令,它所声明的变量就“.原创 2022-03-03 22:02:30 · 521 阅读 · 0 评论 -
ES6新特性|变量的解构赋值
(1)数组的解构赋值数组的解构是要按照顺序排列的let [x,y,z] = [1,2,3];console.log(x,y,z); // 1 2 3对于未取到的值,赋值为undefinedlet [x,y,z] = [1,2];console.log(x,y,z); // 1 2 undefined允许设置默认值let [x,y,z] = [1,2];console.log(x,y,z=3); // 1 2 3用途:字符串截取let str =原创 2022-03-04 11:03:42 · 364 阅读 · 0 评论