0

Why I'm getting [ object Object ] ?

Need help to understand the attached js lines pretty please https://code.sololearn.com/c2JVv7pzgTwU/?ref=app

13th Aug 2021, 10:36 AM
Mohd Aadil
Mohd Aadil - avatar
2 odpowiedzi
+ 3
Since <obj> is an array, you can use forEach() method obj.forEach( o => console.log( `${o.name} height is ${o.height}cm` ) );
13th Aug 2021, 11:19 AM
Ipang