Setting default optional values in JavaScript is usually done via the || character
||
var Car = function(color) { this.color = color || \'blue\'; };
How about:
this.hasWheels = (typeof hasWheels !== 'undefined') ? hasWheels : true;
Your other option is:
this.hasWheels = arguments.length > 0 ? hasWheels : true;