BlackFriday 2024! 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 3 Question 92 Discussion

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

Refer to the code below:

const car = {

price:100,

getPrice:function(){

return this.price;

}

};

const customCar = Object.create(car);

customCar.price = 70;

delete customCar.price;const result = customCar.getPrice();

Whatis the value of result after the code executes?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Paola
1 months ago
Hmm, this one's got me stumped. I'll go with B) undefined, but I hope I'm wrong - that would be a real 'car-tastrophe'!
upvoted 0 times
...
Markus
1 months ago
Clearly the answer is B) undefined. Deleting a property is like making it disappear - no more 'price' property means no more 'this.price' to return.
upvoted 0 times
Long
10 days ago
Yes, the value of result will be undefined after deleting the 'price' property.
upvoted 0 times
...
Melissia
12 days ago
I agree, deleting the 'price' property makes the result undefined.
upvoted 0 times
...
Avery
24 days ago
I think the answer is B) undefined.
upvoted 0 times
...
...
Hyman
1 months ago
Easy peasy, the answer is B) undefined. When you delete a property, it's gone, and 'this.price' will return nothing.
upvoted 0 times
Vivienne
14 days ago
D) 70
upvoted 0 times
...
Valentine
27 days ago
C) null
upvoted 0 times
...
Shala
30 days ago
B) undefined
upvoted 0 times
...
Clement
1 months ago
A) 100
upvoted 0 times
...
...
Craig
2 months ago
I agree with France, the value of result is undefined because customCar.price was deleted.
upvoted 0 times
...
Sanda
2 months ago
I'm going with D) 70. Even though the 'price' property is deleted, the 'customCar' object still inherits the 'price' property from the 'car' object, so 'getPrice' should return 70.
upvoted 0 times
...
France
2 months ago
I believe the value of result is undefined.
upvoted 0 times
...
Rebeca
2 months ago
Definitely B) undefined. Deleting the 'price' property from the 'customCar' object means it will no longer have a local 'price' property, so 'this.price' will return undefined when called.
upvoted 0 times
Weldon
1 months ago
So, the correct answer is B) undefined.
upvoted 0 times
...
Bronwyn
1 months ago
Yes, deleting the 'price' property will make it undefined.
upvoted 0 times
...
Shay
1 months ago
I believe it is B) undefined as well.
upvoted 0 times
...
Barney
2 months ago
I think the value of result is B) undefined.
upvoted 0 times
...
...
Jerilyn
2 months ago
I think the value of result is 100.
upvoted 0 times
...
Grover
2 months ago
Hmm, this is tricky. I think the answer is B) undefined. The 'customCar' object inherits the 'getPrice' method from the 'car' object, but the 'price' property is deleted, so 'this.price' will return undefined.
upvoted 0 times
Zachary
1 months ago
That's correct! The value of result will be undefined.
upvoted 0 times
...
Lamar
2 months ago
I think the answer is B) undefined.
upvoted 0 times
...
...

Save Cancel