I'm declaring this array in a javascript script:
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 declare it inside the
$('document').ready(function(){
});
function, then the console.log(status) return me an array of objects (like I want it to be).
But if I declare it outside the document ready function, it will return this string:
[object Object],[object Object],[object Object],[object Object],[object Object]
And, i repeat, it's a string...
Maybe it is something stupid but I can't figure out where the problem is.