您好我想知道如何使用for循环
在对象中添加所有值var myBills = {
myMumAndDad: 1000,
myFamily: 2500,
myPhone: 550,
myTrain: 650,
myTraining: 200,
myInternet: 200,
myAdobe: 200,
myElectric: 400,
myWeb: 100,
myEditor: 100,
myRent: 3000,
myFood: 2000,
};
// Få lavet et loop til at + disse sammen
var allBills = myBills.myMumAndDad + myBills.myFamily + myBills.myPhone + myBills.myTrain + myBills.myTraining + myBills.myInternet + myBills.myAdobe + myBills.myElectric + myBills.myEditor + myBills.myWeb + myBills.myRent + myBills.myFood;
答案 0 :(得分:1)
TopLevelObject