I am working on some project.
I have used to javascript array to store and then send these value to server using the ajax call.
I have create array like below:
var item1 = "first value";
var item2 = 123;
var item3 = "last ele ";
var data = [item1, item2, item3];
console.log(data);
The array elements are the mixture values, means int/string.
Immediate after, I have tried to print array in the console but it says undefined.
Does anyone know to resolve this?
I have also tried to just initialize one array and print it.
But that also not possible.
AS:
var data_array = [1, 2, 3];
console.log(data_array);
Still it say "undefined".