There is no in-built solution for this in JavaScript. An alternative solution can be using the arguments object (in some cases), or passing your own configuration options, similar to this:
const defaults = {
numberWheels: 4,
color: "black",
name: "myCar"
}
class Car {
constructor(options) {
this.wheelsNum = options.numberWheels || defaults.numberWheels;
this.name = options.name || defaults.name;
this.color = options.color || defaults.color;
}
}
This is basically the old school solution, I use the same logic in ES3.