Skip to content

Instantly share code, notes, and snippets.

@AjayPoshak
Last active March 25, 2018 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AjayPoshak/5731575770e7b4a9d9176df9a80bd251 to your computer and use it in GitHub Desktop.
Save AjayPoshak/5731575770e7b4a9d9176df9a80bd251 to your computer and use it in GitHub Desktop.
Adding methods to prototypes
var Notification = function () {
this.notifs = ['A', 'B', 'C']
this.readNotifs = ['B']
this.isPublic = false
}
Notification.prototype = {
markNotifsRead: function() {
//Mark notification read
}
hideNotifs: function() {
// Hide notifications after they have been read
}
markAllNotifsRead: function() {
// Mark all notification read
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment