Skip to content

Instantly share code, notes, and snippets.

@A
Created July 4, 2014 13:34
Show Gist options
  • Save A/7f01d262a5126f33ba36 to your computer and use it in GitHub Desktop.
Save A/7f01d262a5126f33ba36 to your computer and use it in GitHub Desktop.
Animal = (function() {
function Animal(name) {
this.name = name;
}
Animal.prototype.move = function(meters) {
return alert(this.name + (" moved " + meters + "m."));
};
return Animal;
})();
@A
Copy link
Author

A commented Jul 4, 2014

Animal = function (name) {
  this.name = name;
}

Animal.prototype.move = function(meters) {
  return alert(this.name + (" moved " + meters + "m."));
};

Почему не так?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment