0

Why I'm not getting the correct output in console?

As far as i know there's no issue with my code but still can't get the desired output. https://code.sololearn.com/WCQOsJT4fkpy/?ref=app

3rd Sep 2020, 10:06 AM
Pawan
Pawan - avatar
3 odpowiedzi
+ 1
Use objname.key to get its value. obj.key directly check for key in object so better if you write john.birthYear ; or Change birthYear to x in object. You can do as john.x = John.birthYear Then console John.x
3rd Sep 2020, 10:51 AM
Divya Mohan
Divya Mohan - avatar
+ 1
for (var t in john){ console.log(john[t]); } try this
3rd Sep 2020, 11:31 AM
Divya Mohan
Divya Mohan - avatar
0
But what if i want to log the entire john object value, how can i do that? Divya Mohan
3rd Sep 2020, 11:12 AM
Pawan
Pawan - avatar