I am trying to compare a variable to what the variable previously was in the for loop. I run into a problem when I try to reset 'PAsubtotal'
The problem arises on the line:
PAsubtotal=0;
I get the error: "'undefined ' is null or not an object"
The problem arises on the line:
PAsubtotal=0;
I get the error: "'undefined ' is null or not an object"
Code:
var details = new Array();
var cntr=0;
var PAtemp = new String();
var PAsubtotal;
for( var current in me.items ){
var item = me.items[current];
/*This is where I set matrix values*/
PAsubtotal = PAsubtotal + item.price*item.quantity
if (cntr > 0){
if (!(item.size == PAtemp)){
cntr++;
details[cntr][5]= "<TD><b>" + PAsubtotal + "</b></TD></TR>";
PAsubtotal=0;
}
}
cntr++;
PAtemp = item.size;
}
Comment