Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Javascript Developer I Topic 4 Question 85 Discussion

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 85
Topic #: 4
[All Javascript Developer I Questions]

Refer to code below:

function Person() {

this.firstName = 'John';

}

Person.prototype ={

Job: x => 'Developer'

};

const myFather = new Person();

const result=myFather.firstName + ' ' + myFather.job();

What is the value of the result after line 10 executes?

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Enola
9 days ago
Wait, why is the 'Job' property declared with an arrow function? That's not going to work the way we expect. I think I'll have to go with option A - 'Error: myFather.job is not a function'.
upvoted 0 times
...
Shelia
17 days ago
Hmm, the problem seems to be that we're trying to access the 'job' property directly instead of using the 'Job' method on the prototype. I'll go with option D - 'John Developer'.
upvoted 0 times
...
Gracia
18 days ago
But the code defines the Job property on the Person prototype, so it should be D) John Developer.
upvoted 0 times
...
Patti
19 days ago
I disagree, I believe it's A) Error: myFather.job is not a function.
upvoted 0 times
...
Gracia
24 days ago
I think the value of the result is D) John Developer.
upvoted 0 times
...

Save Cancel