I got the following array:
var myarr = [['a','b',1],['c','d',2],['e','f',3]]
and I iterate through it in the following way:
$(myarr).each(function(k, v){
if(this[2] == 2){
//need to make 'c' and 'd' nulls
}
});
So i need to get the key of the array element and change its 1 and 2 values in order the array look like:
[['a','b',1],['0','0',2],['e','f',3]]
I tried the following:
this[0] = this[1] = null;
but obciously it produced no results. Any ideas how to fix it would be welcome. I can use jQuery. Thank you