i try to make a countdown timer from two different times.

Code:
if (oldcolorvar !== newcolor) {	
			if (objtimer[0] < 1) {
				objtimer[0] = new Date().getTime() + 96000;
			}
		      oldcolor[0] = newcolor;
		     
		      time = objtimer[0] - new Date().getTime();
		      timeseconds = time / 1000;
		      return timeseconds;
		}
		       console.log(objtimer[0]);
		       time = objtimer[0] - new Date().getTime();
		       timeseconds = time / 1000;
		       return timeseconds;
but objtimer is always undefined.

I load the variables on index.html :

var objtimer = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0]

When i do console.log(objtimer[0]); before the IF it gives me the value. si it hink i do something wrong with

objtimer[0] = new Date().getTime() + 96000;


Any help is appreciated.