Skip to content

Instantly share code, notes, and snippets.

@egrueter-dev
Last active June 29, 2016 08:55
Show Gist options
  • Save egrueter-dev/0b0a077d6014fedfcfcbb2a9f7bab571 to your computer and use it in GitHub Desktop.
Save egrueter-dev/0b0a077d6014fedfcfcbb2a9f7bab571 to your computer and use it in GitHub Desktop.
class Person {
constructor(firstname, lastname) {
this.firstname = firstname;
this.lastname = lastname;
}
greet () {
return 'hi ' + firstname;
}
}
@pombadev
Copy link

Should not the line

return 'hi ' + firstname;

be as

return 'hi ' + this.firstname;

and same goes when you are extending from the Person class in es6-and-classes-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment