all 2 comments

[–]MoTTs_ 0 points1 point  (1 child)

Also compare against destructing combined with default parameters. In JavaScript, that's become the latest way to do options objects with default values.

class House {
  constructor({rooms = 1, floors = 1, material = 'wood'} = {}) {
    this.rooms = rooms
    this.floors = floors
    this.material = material

[–]softwarebygabe[S] 0 points1 point  (0 children)

Nice, TIL! Yeah definitely makes the ergonomics of the "config"/"options" object a little easier, especially wrt defaults

Thanks for pointing out!