Last active
June 24, 2018 18:31
-
-
Save moose56/a24d447069a8ee7c91d64551543f0538 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Person(name) { | |
this.name = name; | |
} | |
Person.prototype.greet = function() { | |
console.log("Hello, my name is" + this.name); | |
} | |
// as of 2015... | |
class Person { | |
constructor(name){ | |
this.name = name; | |
} | |
greet() { | |
console.log("Hello, my name is" + this.name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment