Created
July 12, 2018 11:19
-
-
Save jaamaalxyz/c9b44d77f1aecd79a32a3521a61dbfb9 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
| var Person = function(firstAndLast) { | |
| let firstName = firstAndLast.split(' ')[0]; | |
| let lastName = firstAndLast.split(' ')[1]; | |
| this.getFirstName = function(){ | |
| return firstName; | |
| }; | |
| this.getLastName = function(){ | |
| return lastName; | |
| }; | |
| this.getFullName = function(){ | |
| return firstName + ' ' + lastName; | |
| }; | |
| this.setFirstName = function(first){ | |
| firstName = first; | |
| }; | |
| this.setLastName = function(last){ | |
| lastName = last; | |
| }; | |
| this.setFullName = function(firstAndLast){ | |
| firstName = firstAndLast.split(' ')[0]; | |
| lastName = firstAndLast.split(' ')[1]; | |
| }; | |
| }; | |
| var bob = new Person('Bob Ross'); | |
| bob.getFullName(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment