Can you please show me a simple code which add unlimited values into JavaScript objects. I don't want single view "Toyota, 2014". I want show lists value after I add value from textbox.
class Car {
constructor(name, year) {
this.name = name;
this.year = year;
}
}
At code below, this is single value to add, but I need add many value doesn't matter, how many of number I want to add.
const myCar = new Car("Toyota", 2014);
I expect to view many different values like
Toyota, 2014
Opel, 2018
Volkswagen, 2021
and many mores