本節(jié)練習
編寫程序,實現(xiàn)下列需求:計算下面fruit對象共有多少個水果,應(yīng)該輸出50。
var fruit = {
apple: 20,
pear: 20,
peach: 10
};
// write your code here...
var fruit = {
apple: 20,
pear: 20,
peach: 10
};
var t = fruit.apple+fruit.pear+fruit.peach;
console.log(t);