I am not sure i named the title properly. Let me explain my little problem.
My code snipppet is pretty short:
var myArray= new Array([new Date()],[123],[abc]);
var time = myArray[0].getTime()
I want the time saved in the object inside the array to be written to the "time" variable. I just thought this would work but i get an error.
Uncaught TypeError: myArray[0].getTime is not a function
Apparently i am doing it wrong, but i have no idea what is the problem and how to do it right.
Its inside of another array:
var time = myArray[0][0].getTime();
// ^^^
Working example:
var myArray = new Array([new Date()], [123], ['abc']),
time = myArray[0][0].getTime();
alert(time);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments