Skip to content

Instantly share code, notes, and snippets.

View mikeyk's full-sized avatar

Mike Krieger mikeyk

  • San Francisco, CA
View GitHub Profile
function Post(){};
Post.prototype = {test : function(){console.log("hello there")}};
p = new Post();
p.test();
/* but I prefer to do two things differently: define my member functions in the 'class' function, and have objects inherit from objects: */
function Post() {
this.test = function(){ console.log("hello there") }
}