46 lines
591 B
JavaScript
Executable File
46 lines
591 B
JavaScript
Executable File
for (let name of names) {
|
|
console.log(name);
|
|
}
|
|
|
|
let car = {
|
|
model: "Golf",
|
|
make: "Volkswagen",
|
|
year: 1999,
|
|
color: "black",
|
|
};
|
|
|
|
for (let prop in car) {
|
|
console.log(car[prop]);
|
|
}
|
|
|
|
for (let prop in car) {
|
|
console.log(prop);
|
|
}
|
|
|
|
let cars = [
|
|
{
|
|
model: "Golf",
|
|
make: "Volkswagen",
|
|
year: 1999,
|
|
color: "black",
|
|
},
|
|
{
|
|
model: "Picanto",
|
|
make: "Kia",
|
|
year: 2020,
|
|
color: "red",
|
|
},
|
|
{
|
|
model: "Peugeot",
|
|
make: "208",
|
|
year: 2021,
|
|
color: "black",
|
|
},
|
|
{
|
|
model: "Fiat",
|
|
make: "Punto",
|
|
year: 2020,
|
|
color: "black",
|
|
},
|
|
];
|