Skip to content

Instantly share code, notes, and snippets.

@ilearnjavascript
Created March 27, 2019 23:37
Show Gist options
  • Save ilearnjavascript/7636128cf99dd4c20bf87d7353dc3e28 to your computer and use it in GitHub Desktop.
Save ilearnjavascript/7636128cf99dd4c20bf87d7353dc3e28 to your computer and use it in GitHub Desktop.
es6 - classes - 3.js
var es5_Person = function (firstname, lastname) {
this.firstname = firstname;
this.lastname = lastname;
}
var john = new es5_Person('John', 'Doe');
var jane = new es5_Person('Jane', 'Doe');
console.log(john); // outputs: es5_Person {firstname: "John", lastname: "Doe"}
console.log(jane); // outputs: es5_Person {firstname: "Jane", lastname: "Doe"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment