When i console.log an object in js it output [Object object] why. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When i console.log an object in js it output [Object object] why.

5th May 2023, 7:47 AM
Anton Drud
Anton Drud - avatar
4 Answers
+ 5
That's just how it shows in the SL playground mobile version. - You can check the object either by using the JSON stringify method - JSON.stringify(a) or You can console it in the nodejs playground
5th May 2023, 8:37 AM
zexu knub
zexu knub - avatar
+ 3
Share your code
5th May 2023, 7:58 AM
Sakshi
Sakshi - avatar
+ 2
Thanks
5th May 2023, 8:40 AM
Anton Drud
Anton Drud - avatar
+ 1
My code: let a = { b: "c" } console.log(a);
5th May 2023, 8:03 AM
Anton Drud
Anton Drud - avatar