简化对象写法:
传统写法:
javascript
var x = 10, y = 20;
var obj = {x: x, y: y};
简化写法:
javascript
var x = 10, y = 20;
var obj = {x, y};
简化函数写法:
传统写法:
javascript
function add(x, y) {
return x + y;
}
简化写法:
javascript
var add = (x, y) => x + y;