标签:hang func like ons name console 对象 java imp
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);
标签:hang func like ons name console 对象 java imp
原文地址:https://www.cnblogs.com/AaronNotes/p/14362045.html