Skip to content

Instantly share code, notes, and snippets.

@raduGaspar
Last active April 1, 2019 16:55
Show Gist options
  • Save raduGaspar/d1a1a4866a49aa8e6b4b6df45963522f to your computer and use it in GitHub Desktop.
Save raduGaspar/d1a1a4866a49aa8e6b4b6df45963522f to your computer and use it in GitHub Desktop.
A grouping of related properties and methods
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