This is the array that I have but I have no Idea how to access the first object's individual properties.
let cars = [
{
"color": "purple",
"type": "minivan",
"registration": new Date('2017-01-03'),
"capacity": 7
},
{
"color": "red",
"type": "station wagon",
"registration": new Date('2018-03-03'),
"capacity": 5
}]
console.log(cars[0].color)
>>> "purple"
Try the MDN js docs to learn the basics https://developer.mozilla.org/en-US/docs/Web/JavaScript
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.