简化对象写法
ES6允许再大括号里面,直接写入变量和函数,作为对象的属性和方法。
遮眼法的书写更加简洁
let name = 'study';
let change = function(){
consoel.log('I like study');
}
const study = {
name,
change,
improve(){
console.log("day day up");
}
}
console.log(study);
ES6允许再大括号里面,直接写入变量和函数,作为对象的属性和方法。
遮眼法的书写更加简洁
let name = 'study';
let change = function(){
consoel.log('I like study');
}
const study = {
name,
change,
improve(){
console.log("day day up");
}
}
console.log(study);