Last active
June 29, 2016 08:55
-
-
Save egrueter-dev/0b0a077d6014fedfcfcbb2a9f7bab571 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
constructor(firstname, lastname) { | |
this.firstname = firstname; | |
this.lastname = lastname; | |
} | |
greet () { | |
return 'hi ' + firstname; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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