Last active
April 1, 2019 16:55
-
-
Save raduGaspar/d1a1a4866a49aa8e6b4b6df45963522f to your computer and use it in GitHub Desktop.
A grouping of related properties and methods
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
const user = { | |
firstName: "John", | |
lastName: "Doe", | |
sleepCounter: 0, | |
eat: function() {}, | |
sleep: function() { | |
return `${this.firstName} is asleep for the ${++this.sleepCounter} time`; | |
}, | |
code: function() {}, | |
repeat: function() {}, | |
} | |
user.sleep() | |
// no arrow functions here, there be dragons |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment