In a class like the following:
class Rect {
constructor({ x = 0, y = 0, width = 0, height = 0, bgColor = "#000000" } = {}) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.bgColor = bgColor;
}
}
It seems like there's a lot of repetition when assigning everything to the class object and I was wondering if there was some way to do it all at once.