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:

Jordan
1 months ago
Wait, is this a trick question? I'm going to go with option D, but I'm secretly hoping it's a joke and the real answer is 'John, the Developer'.
upvoted 0 times
Carlee
3 days ago
Yeah, it makes sense that the result would be 'John Developer'.
upvoted 0 times
...
Azalee
4 days ago
I agree, it should be 'John Developer'.
upvoted 0 times
...
Rodney
11 days ago
I think it's option D, 'John Developer'.
upvoted 0 times
...
...
Clare
1 months ago
Haha, this code is a bit of a mess, isn't it? I'm going to have to go with option D though - 'John Developer'. It's the only one that makes sense to me.
upvoted 0 times
Garry
7 days ago
Definitely, option D is the only one that fits with the code logic.
upvoted 0 times
...
Justine
15 days ago
Yeah, I agree. 'John Developer' makes the most sense given the code provided.
upvoted 0 times
...
Jill
22 days ago
Definitely, option D is the only one that fits with the code logic.
upvoted 0 times
...
Valentin
1 months ago
I think you're right, option D does seem to be the correct answer.
upvoted 0 times
...
Tequila
1 months ago
Yeah, I agree. 'John Developer' makes the most sense given the code provided.
upvoted 0 times
...
Rose
1 months ago
I think you're right, option D does seem to be the correct answer.
upvoted 0 times
...
...
Dalene
2 months ago
This is a tricky one! I'm going to have to agree with Enola - that arrow function on the prototype is going to cause some issues. I'll go with option A as well.
upvoted 0 times
...
Enola
2 months 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
Stephanie
2 days ago
Looks like option A is the correct choice.
upvoted 0 times
...
Dalene
4 days ago
So 'myFather.job' is not a function because of that.
upvoted 0 times
...
Jerry
23 days ago
Yeah, arrow functions don't bind 'this' like regular functions do.
upvoted 0 times
...
Lindsey
1 months ago
I think you're right, the arrow function syntax is causing an issue here.
upvoted 0 times
...
...
Shelia
2 months 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
Mike
1 months ago
Yes, you're right. We need to use the 'Job' method on the prototype to access the value.
upvoted 0 times
...
Gracia
1 months ago
So, the correct answer is D) John Developer.
upvoted 0 times
...
Antonio
1 months ago
Yeah, the 'Job' method on the prototype should be used.
upvoted 0 times
...
Elenor
1 months ago
I agree, it should be 'John Developer'.
upvoted 0 times
...
Kristel
2 months ago
I think the value of result is 'John Developer'.
upvoted 0 times
...
Eun
2 months ago
I think the correct answer is D) John Developer.
upvoted 0 times
...
...
Gracia
2 months ago
But the code defines the Job property on the Person prototype, so it should be D) John Developer.
upvoted 0 times
...
Patti
2 months ago
I disagree, I believe it's A) Error: myFather.job is not a function.
upvoted 0 times
...
Gracia
2 months ago
I think the value of the result is D) John Developer.
upvoted 0 times
...

Save Cancel