Background: In the simplified data structure below accessing individual items and their properties is straightforward. For example the value Volkswagon is easy to access.
let car = {};
let truck = {};
car.one = 'Volkswagon';
car.two = 'Toyota';
truck.one = 'Dakota';
truck.two = 'Tacoma';
let vehicleArray = [car, truck];
console.log(vehicleArray[0].one); //Volkswagon
Question: However is it possible to access the name's of the objects that are stored in the array? In this case the values car and truck. I'm not sure how to get those out of the array.
The code below returns properties and values inside the object but not the object's name.
console.log(vehicleArray[0]); // { one: 'Volkswagon', two: 'Toyota' }