Skip to content

Instantly share code, notes, and snippets.

View AjayPoshak's full-sized avatar

Ajay Poshak AjayPoshak

View GitHub Profile
@AjayPoshak
AjayPoshak / prototype-methods.js
Last active March 25, 2018 13:09
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
}
@AjayPoshak
AjayPoshak / prototype.js
Last active January 20, 2018 16:40
Initialization of Prototype
function Notification() {
this.notifs = ['A', 'B', 'C']
this.readNotifs = ['B']
this.isPublic = false
}