Objects and Arrays in JS

Objects

let car = {
    brand: "Tesla",
    model: "Model 3",
    year: 2021,
    drive() {
        console.log("Driving...");
    }
};
console.log(car.brand);
car.drive();

Arrays

let fruits = ["apple", "banana", "cherry"];
fruits.push("date");
console.log(fruits);