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 CRT-600 Topic 6 Question 84 Discussion

Actual exam question for Salesforce's CRT-600 exam
Question #: 84
Topic #: 6
[All CRT-600 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();

What is the value of result after the code executes?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Margurite
23 days ago
I'm going to go with `null` just because it's the most mysterious and least predictable option. JavaScript, you never cease to surprise me!
upvoted 0 times
...
Rolf
26 days ago
This question is like a game of hide-and-seek with JavaScript objects. I'm going with `undefined` just to keep things interesting.
upvoted 0 times
Rodolfo
2 days ago
I believe it's undefined.
upvoted 0 times
...
Tyisha
4 days ago
I think the value of result is 100.
upvoted 0 times
...
...
Jesse
1 months ago
I think the answer is `70`. Even though we deleted the `price` property from `customCar`, it still has the `price` property set to `70` from earlier.
upvoted 0 times
Karma
5 days ago
Because customCar still has the price property set to 70.
upvoted 0 times
...
Chantay
13 days ago
Correct, the value of result is `70`.
upvoted 0 times
...
Tony
24 days ago
I think the answer is `70`.
upvoted 0 times
...
...
Krissy
2 months ago
Wait, didn't we just delete the `price` property from `customCar`? So, shouldn't the result be `undefined`?
upvoted 0 times
...
Heidy
2 months ago
I agree with Rasheeda, the value of result should be undefined.
upvoted 0 times
...
Tu
2 months ago
Hmm, let's see. If we delete the `price` property from `customCar`, it should fall back to the `price` property of the object it's prototypically inheriting from, which is `car`. So, the result should be `100`.
upvoted 0 times
Shawnda
14 days ago
Exactly, the result will be 100.
upvoted 0 times
...
Freida
17 days ago
So, the correct answer is A) 100.
upvoted 0 times
...
Ira
30 days ago
I agree, it should be 100 since customCar falls back to the prototype's price property.
upvoted 0 times
...
Felix
1 months ago
I think the value of result is 100.
upvoted 0 times
...
...
Rasheeda
2 months ago
I believe the value of result is undefined because customCar.price is deleted.
upvoted 0 times
...
Esteban
2 months ago
I think the value of result is 100.
upvoted 0 times
...

Save Cancel