Created
September 25, 2015 22:13
-
-
Save luijar/7fb9779795da0cdf6bff to your computer and use it in GitHub Desktop.
Simple person class
This file contains 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; | |
} | |
set firstname(f) { | |
this._firstname = f; | |
} | |
set lastname(l) { | |
this._lastname = l; | |
} | |
get firstname() { | |
return this._firstname; | |
} | |
get lastname() { | |
return this._lastname; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment