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
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
+ 1
for (var t in john){
console.log(john[t]);
}
try this
0
But what if i want to log the entire john object value, how can i do that? Divya Mohan