var data = [
{
code: 42,
items: [{
id: 1,
name: 'foo'
}, {
id: 2,
name: 'bar'
}]
}];
console.log(data.items[0].name === 'foo');
I am trying to access the key and checking if the value are same then return true or false, I am getting an error while accessing it.