Cyber Monday 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
2 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
2 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
1 months ago
Yes, the value of result will be undefined after deleting the 'price' property.
upvoted 0 times
...
Melissia
1 months ago
I agree, deleting the 'price' property makes the result undefined.
upvoted 0 times
...
Avery
2 months ago
I think the answer is B) undefined.
upvoted 0 times
...
...
Hyman
2 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
1 months ago
D) 70
upvoted 0 times
...
Valentine
2 months ago
C) null
upvoted 0 times
...
Shala
2 months ago
B) undefined
upvoted 0 times
...
Clement
2 months ago
A) 100
upvoted 0 times
...
...
Craig
3 months ago
I agree with France, the value of result is undefined because customCar.price was deleted.
upvoted 0 times
...
Sanda
3 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
3 months ago
I believe the value of result is undefined.
upvoted 0 times
...
Rebeca
3 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
2 months ago
So, the correct answer is B) undefined.
upvoted 0 times
...
Bronwyn
2 months ago
Yes, deleting the 'price' property will make it undefined.
upvoted 0 times
...
Shay
2 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
3 months ago
I think the value of result is 100.
upvoted 0 times
...
Grover
3 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
2 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
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77