x
is not a value It is a index
like 0,1 ...14, you can use of
for that or use data[x]
inside in
.
var data = [{
Name: "First Last",
ID: "12536723",
Status: "Member"
}, {
Name: "First Last",
ID: "12371238",
Status: "Member"
},
{
Name: "First Last",
ID: "12341228",
Status: "Member"
}
]
for (var x in data) {
console.log(data[x].Name); //x is not a value It is a index like 0,1 ...14
}
for (var x of data) {
console.log(x.Name); // use of which prints x as object not index
}