In my JavaScript script, I am defining this array:
var status=[
{
"name":"name1",
"level":0
},
{
"name":"name2",
"level":0
},
{
"name":"name3",
"level":0
},
{
"name":"name4",
"level":0
},
{
"name":"name5",
"level":0
}];
console.log(status);
If I define it within the
$('document').ready(function(){
});
function, then the console.log(status) shows an array of objects (which is what I intend).
However, if I define it outside the document ready function, the result will be:
[object Object],[object Object],[object Object],[object Object],[object Object]
And, as mentioned earlier, this is a string...
Perhaps it's something simple, but I cannot pinpoint where the issue lies.