0

My class' constructor looks like this:

class Customer {
  constructor(params) {
    this.id = params.id;
    this.firstName = params.firstName;
    this.lastName = params.lastName;
  }
}

I like using named parameters (my object actually has more parameters than this).

In ECMAScript 2015/2016 is there a better way of assigning the variables than this?

cubabit
  • 2,135
  • 2
  • 17
  • 31

0 Answers0