let foo = ["a","b","c"]
let [a,b] = foo; // a = "a" ; b = "b"
class A{
constructor(name,age){
this.name = name;
this.age = age
}
}
//
class B extends A{
constructor(){
// 子类必须在constructor 中指定super 函数
// 如果没有置顶constructor 默认带super的函数的constructor 将会被添加
super("lxy",25)
}
}
export const a = "123"
export default {
}
import A from "a" // a.js
let c = "c"
let b = `ab ${a}` // abc
const a = "a"
const b = "b"
const c = {
a:a
b:b
}
// 简写
const c = {
a,
b
}
let req = new Promise((resolve,reject)=>{
setTimeout(resolve,1000)
})
req.then(res => {
console.log(res)
})