Looking to create an object, let's call it "car":
function car(name, speed, options){
this.name = name;
this.speed = speed;
this.options = options;
}
When it comes to the "options", I thought of using an array:
var carMustang = new car("Mustang", 250, ["Cruise Control","Air Conditioning", "ABS"]);
However, it seems that passing an array to a function is not working as I anticipated based on my research.
The main question here is: Is this a practical approach for constructing these objects? If you need to pass numerous properties to an object, and there will be a substantial amount of these objects, what would be your strategy?
Extra credit: if you have a solution for my complication with passing array data to an object constructor, I would greatly appreciate it.
Thank you