es6 is actually because the array is linear with the Symbol.iterator attribute. But the object doesn"t have an iterator interface, so how can you use the expansion operator? And. How on earth is the unfold operator implemented?
es6 is actually because the array is linear with the Symbol.iterator attribute. But the object doesn"t have an iterator interface, so how can you use the expansion operator? And. How on earth is the unfold operator implemented?
let baseArr = [1,2,3]
let arr = [0,...baseArr,4];
//------------transform-------------------
var arr = [0].concat(baseArr, [4])[0];
let baseObj = {name:'a'};
let obj = {age:1,...baseObj,name:'b'}
//------------transform-------------------
var obj = _extends({ age: 1 }, baseObj, { name: 'b' });
Previous: Sql query. If there is no data in a field, the default data is set.
Next: Why does each .vue file package a separate css file when vue-cli 3.0 is packaged?