Skip to content

Instantly share code, notes, and snippets.

@blizzarddreams
Created December 17, 2015 04:31
Show Gist options
  • Select an option

  • Save blizzarddreams/04bf55364e2eb23c208e to your computer and use it in GitHub Desktop.

Select an option

Save blizzarddreams/04bf55364e2eb23c208e to your computer and use it in GitHub Desktop.
// ES6
class Dog {
constructor(name) {
this.name = name;
}
bark() {
alert("Bark!");
}
}
let beethoven = new Dog("Beethoven");
console.log(beethoven);
// ES5
function Dog(name) {
this.name = name;
}
Dog.prototype.bark = function() {
alert("Bark!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment