You can do this:
this.hasWheels = hasWheels !== false;
That gets you a true value except when hasWheels is explicitly false. (Other falsy values, including null and undefined, will result in true, which I think is what you want.)
You can do this:
this.hasWheels = hasWheels !== false;
That gets you a true value except when hasWheels is explicitly false. (Other falsy values, including null and undefined, will result in true, which I think is what you want.)