Last active
December 24, 2015 10:49
-
-
Save stevencombs/6786508 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
// 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