0

I'm reading about mixins here and it uses this valid code:

let sayHiMixin = {
  sayHi() {
    alert(`Hello ${this.name}`);
  },
  sayBye() {
    alert(`Bye ${this.name}`);
  }
};

console.log(sayHiMixin);

sayHiMixin is a valid object. Can anyone point out to me how the syntax for writing this object is valid (maybe an MDN page)? I've never seen it before except for when writing methods in a class.

georgeawg
  • 48,608
  • 13
  • 72
  • 95
tonitone120
  • 1,920
  • 3
  • 8
  • 25

0 Answers0