Print values of JavaScript Object

I print some results as:

arr.forEach(el => console.log(el));

and I receive results of the form:

{
  x: NamedNode {
    termType: 'NamedNode',
    value: 'http://dbpedia.org/resource/Ajamaru_Lakes_rainbowfish'
  }
}
{
  x: NamedNode {
    termType: 'NamedNode',
    value: 'http://dbpedia.org/resource/Akarotaxis_nudiceps'
  }
}

However, I would like to print only the value of each NamedNode, e.g. ‘http://dbpedia.org/resource/Ajamaru_Lakes_rainbowfish’

Could you help me, please?

Answer

Try:

arr.forEach(el => console.log(el.x.value));
Source: stackoverflow
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .