我不明白为什么解构赋值后,items
prop 不等于Gorilla
。
将在删除items: "Piggi"
原始对象选项中的主要道具后使用。我不明白为什么...
'use strict';
let options = {
size: 100,
items: "Piggi"
}
let { title="Menu", items:w="Gorilla", size } = options;
let a = title;
let b = w;
console.log(a + " - " + b); // must be "Menu - Gorilla"