摘要:
//声明一个对象 const banji = { name: "一班", stus: [ "xiaobai", "xiaohei", "xiaohua", "king" ], [Symbol.iterator]() { //声明索引变量 let index = 0; let _this = this 阅读全文
摘要:
箭头为=何>的结合体 声明和调用 // let fn=function(){ // } let fn = (a, b) => { return a + b; } //调用函数 let rest = fn(1, 2); console.log(rest); 特性 1this是静态的,始终指向函数声明的 阅读全文
摘要:
name = "xiaobai"; chage = function() { console.log("我想改变"); } const Xiaobai = { name, chage, fly() { console.log("我想飞"); } } 变量和函数都可以省略冒号后面的属性 里面声明的函数 阅读全文
摘要:
//数组解构 const f4 = [小白, 小黄, 小黑, 小花]; let [bai, huang, hei, hua] = f4; console.log(bai); console.log(huang); console.log(hei); console.log(hua); //对象解构 阅读全文
摘要:
1为常量声明。一定要赋初始值 2一般常量使用大写 3一般常量值不能修改 4为块级作用域 阅读全文
摘要:
特性 1变量不能重复声明 2块级作用域内声明只在内部生效 3不存在变量提升 let a = "a"; console.log(a); { let f = "aaa"; } //console.log(f); 4不影响作用域链 阅读全文