165
rated 0 times
[
166]
[
1]
/ answers: 1 / hits: 76659
/ 9 Years ago, tue, december 29, 2015, 12:00:00
I have an object with key value pairs inside an array:
var data = [
{
errorCode:100,
message:{},
name:InternetGatewayDevice.LANDevice.1.Hosts.HostNumberOfEntries,
value:2
}
];
I want to get the value of value key in the object. ie, the output should be 2.
I tried this:
console.log(data[value]);
console.log(data.value);
Both logging undefined. I saw similar questions in SO itself. But, I couldn't figure out a solution for my problem.
More From » arrays