+ 8
Why dosent it prints the object?
I have made this object ,but when i am printing it its just showing [objects,objects], Is there any problem in the code , Please help https://code.sololearn.com/W5GEZvQUm4mm/?ref=app
2 Respostas
+ 6
No it is right but for some reason it doesn't show the object values ,you need to iterate over the object to see values or you can use =>JSON.stringify(myObj)
+ 5
If you want to access all Values which you write then you have to access like this
let myobj = {
'name': 'ashwin',
age: '17',
hello: true,
marks: [1,5,3,6]
}
document.write(myobj.hello);
document.write(myobj.marks);
document.write(myobj.age);
//console.log(myobj['age'])
//console.log(myobj.marks)