Last active
January 18, 2019 02:34
-
-
Save rxluz/ac12b11da6d330015d9d2a28f7727a9b to your computer and use it in GitHub Desktop.
S.O.L.I.D Principles for JS with examples, see more at https://medium.com/p/db95b44e82e
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 User { | |
constructor(name, age) { | |
this.name = name; | |
this.age = age; | |
this.logs = []; | |
} | |
setName(name) { | |
this.name = name; | |
this.logs.push("Edited user name"); | |
} | |
setAge(age) { | |
this.age = age; | |
this.logs.push("Edited user age"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment