0
Where is my mistake in object?
var person = { color: "green", height: 12 name:"harry", age: 13, }; var x = person.age var y = person["age"] document.write(x) document.write(y)
2 ответов
+ 1
Harry star , you haven't put a comma after height:12.
That is why you are getting the error.
- 2
First don't use document.write()
Second person has on property "age". person has age property.
Third use console.log() for debugging