Why I'm getting [ object Object ] ? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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
1 ответ
+ 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