While doing some typescript I came over this thing I havent seen before in javascript.
constructor(public x: number = 0, public y: string = "none"){
this.color = "red";
}
that part is compiling into:
if (x === void 0) { x = 0; }
if (y === void 0) { y = "none"; }
But shouldn't it be typeof x === 'undefined'
? if not, which one is better and why?
thanks