This is my object.
values : {
title : 'this is title ..',
translate : {
en : 'some texts .. ',
},
}
And this is array I have.
arr = ['translate.en', 'title'];
What I want to do is this, but this is not work as I expected.
const value = arr.map(item => values[item]);
// (Result) value : undefined, 'this is title ..'
// (Expected) value : 'some texts .. ', 'this is title ..'
const value = arr.map(item => values.item); // error : 'item' is declared but its value is never read.
How to get values.translate.en value using map()?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)