Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Last active December 24, 2015 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencombs/6786508 to your computer and use it in GitHub Desktop.
Save stevencombs/6786508 to your computer and use it in GitHub Desktop.
// Javascript Getting Started with Programming
// A Codecademy Javascript (Fun with Functions) assignment
// Dr. Steven B. Combs, coding novice
// Constructor object notation
function Person(job, married) {
this.job = job;
this.married = married;
this.speak = function () { // Object with function (or method when a part of an object)
console.log ("Hello!");
};
}
var user = new Person("Codecademy Student",false);
user.speak(); // Calls the method in the object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment