对比
全写
let user = {
username:'lake',
login:function(){
//exec login service
}
}
方法简写
let user = {
username:'lake',
login(){
//exec login service
}
}
属性引用简写
let username = 'lake';
let user = {
username,
login(){
//exec login service
}
}
对象合并
let user = {
username:'lake',
age:24
}
let admin = {
...user,
type:'ADMIN'
}
合并后的对象
{
username:'lake',
age:24,
type:'ADMIN'
}
```w