Introfuction to Objects II 2. Fun with Functions


#1

Can anyone suggest what is wrong with the below code
Course: JavaScript
Unit 8: Objects II
Lesson: Introduction to Objects II
Chapter: 2. Fun with Functions

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

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


#2

Just refresh the page :slight_smile:


#3

That solved the issue. Thanks :slight_smile:


#4

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