I have a JavaScript like this:
var metFital = { "IMP_TRAV_SP": { type: "cont", Est: 0.055 },....}
var IMP_TRAV_SP= 20;
var EvalueFital=0
for (var par in metFital) {
if (metFital[par].type == "cont") {
EvalueFital = EvalueFital + ((metFital[par].Est) *par);
}
};
I want to loop through the object "metFital", to get the "Est". Then calculate "Est"*par.
For instance when par="IMP_TRAV_SP"(first iteration of the loop), then I can get the value of Est*IMP_TRAV_SP. How should I write the stuff under the if statement?