To extract a value from a JSON array, I am utilizing the find
method in this manner:
let actualElm = this.initialData.find(elm => {
if (elm.identifiant == this.actualId) {
return elm.country;
}
});
An issue with using find
is that it returns the entire object (elm
object), when all I need is elm.country
.
Is there a better approach to achieve my desired result?