本節(jié)練習(xí)
編寫程序烁兰,實(shí)現(xiàn)下列需求:計(jì)算下面fruit對(duì)象共有多少個(gè)水果耐亏,應(yīng)該輸出50。
var fruit = {
apple: 20,
pear: 20,
peach: 10
};
var and;
and=fruit.apple+fruit.pear+fruit.peach;
console.log(and);
編寫程序烁兰,實(shí)現(xiàn)下列需求:計(jì)算下面fruit對(duì)象共有多少個(gè)水果耐亏,應(yīng)該輸出50。
var fruit = {
apple: 20,
pear: 20,
peach: 10
};
var and;
and=fruit.apple+fruit.pear+fruit.peach;
console.log(and);