Exam4Training

What is the output after the code executes?

Refer to the code below:

Function Person (firstName, lastName, eyecolor) {

this.firstName =firstName;

this.lastName = lastName;

this.eyeColor = eyeColor;

}

Person.job = ‘Developer’;

const myFather = new Person(‘John’, ‘Doe’);

console.log(myFather.job);

What is the output after the code executes?
A . ReferenceError: eyeColor is not defined
B . ReferenceError: assignment to undeclared variable “Person”
C . Developer
D . Undefined

Answer: D

Exit mobile version