1. 解构分为解构数组和解构对象 参考 https://www.runoob.com/w3cnote/deconstruction-assignment.html 【仅作为个人学习转载记录】 2. 结合 剩余参数 代码示例: // 解构数组 let arr = ['blue', 'pink', 'g Read More
posted @ 2021-08-09 17:43
TwinkleG
Views(234)
Comments(0)
Diggs(0)
【this一般指向自身所处函数的调用者】 箭头函数自身不具备this,箭头函数中的this等于定义箭头函数位置的this let obj = { name: "James" }; function funcThisTest() { console.log(this); return function Read More
posted @ 2021-08-09 17:18
TwinkleG
Views(55)
Comments(0)
Diggs(0)
1. 若函数体只有一句代码,且代码执行结果为返回值,则函数体大括号以及return可省略 正常函数形式: let normal_func = function (num1, num2) { return num1 + num2; }; 使用箭头函数形式: let arrow_func = (num1 Read More
posted @ 2021-08-09 17:10
TwinkleG
Views(45)
Comments(0)
Diggs(0)
let的特性: 【ES6是指ES2015以及之后的更新版本,即ES2016、ES2017......】 1. 具有块级作用域 if (true) { var num = 10; console.log(num); // 10 } console.log(num); // 'num' is not d Read More
posted @ 2021-08-09 16:35
TwinkleG
Views(72)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号