Skip to content

Instantly share code, notes, and snippets.

@PirosB3
Created February 20, 2012 09:15
Show Gist options
  • Save PirosB3/1868524 to your computer and use it in GitHub Desktop.
Save PirosB3/1868524 to your computer and use it in GitHub Desktop.
differences? when should I use one or the other?
function TestMe(name) {
this.name = name;
}
TestMe.prototype.sayHello = function() {
return "Hello my name is " + this.name;
}
testme = function(name) {
return {
sayHello: function() {
return "Hello, my name is " + name;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment