Skip to content

Instantly share code, notes, and snippets.

@me-shaon
Last active November 7, 2017 12:44
Show Gist options
  • Save me-shaon/e78cb61e0189ff62eae0360170deb294 to your computer and use it in GitHub Desktop.
Save me-shaon/e78cb61e0189ff62eae0360170deb294 to your computer and use it in GitHub Desktop.
Javascript Object 3
//This is known as constructor function or kind of a template for objects
function person(first, last, age) {
this.firstName = first;
this.lastName = last;
this.age = age;
}
var newPerson = new person("John", "Doe", 50); //this is a an object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment