"use strict";
class Asn {
constructor(params = {}) {
this.x = 0;
this.y = 0;
this.height = 1;
this.width = 1;
Object.assign(this, params);
}
}
const a = new Asn({ x:3, y: 0, height: 23, width: 1});
console.assert(a.x === 3)
"use strict";
class Box {
constructor(params = {}) {
var { x = 0, y = 0, height = 1, width = 1 } = params;
this.x = x;
this.y = y;
this.height = height;
this.width = width;
}
}
const b = new Box({ x:3, y: 0, height: 23, width: 1});
console.assert(b.x === 3)