Introduction to Objectsii 2/30


function Person(job, married) {
this.job = job;
this.married = married;
// add a "speak" method to Person!
this.speak = function(){

var user = new Person("Codecademy Student",false);

Add a speak method to the Person constructor. Whenever speak is called, it should print "Hello!" to the console.


So, you are yet to "log" your new method. A clue is to do:



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.