Skip to content

Commit

Permalink
different pattern for object literal extension
Browse files Browse the repository at this point in the history
  • Loading branch information
hisbvdis committed Sep 20, 2022
1 parent 832570d commit 7f1b42f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion submissions/hisbvdis/oop-exercise/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class Human extends Creature {
constructor(name, gender, saying) {
super("human", name, gender, saying, 2);
this.hands = 2;
this.props = this.props.concat({prop: "hands", preface: "I have hands:"});
this.props = [
...this.props,
{ prop: "hands", preface: "I have hands:" },
]
}
}

Expand Down

0 comments on commit 7f1b42f

Please sign in to comment.