Here is an explanation of what I want. let's say we have an array of objects.
the first console.log
works as expected but I can't make the second one work correctly... I want the second console.log
to do the same thing as the first one.
How can do this?
var sentences = [
{ passed: {mean: 10, shadow: 11, write: 12}}
];
let a = 'mean';
console.log(sentences[0].passed.mean)
console.log(sentences[0].passed.a);