untitled notebook

node v6.17.1
endpointsharetweet
// works like EventEmitter var EventThing = {} EventThing.on = function(event, msg) { return event+" event says "+msg } console.log(EventThing.on("bam", "hi")) // works like Supermodel var Supermodel = Object.create(EventThing) Supermodel.init = function(name) { this.name = name } Supermodel.create = function(item) { return "made a "+item } console.log(Supermodel.create("banana")) // works like Post var Post = Object.create(Supermodel) Post.init("posssttttt") Post.create = function(post) { return Supermodel.create(this.name+" "+post) } console.log(Post.create("apple"))
Loading…

no comments

    sign in to comment