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 Salesforce Certified JavaScript Developer I exam
Question #: 85
Topic #: 4
[All Salesforce Certified JavaScript Developer I Questions]

Refer to the following code that performs a basic mathematical operation on a provided

input:

function calculate(num) {

Return (num +10) / 3;

}

How should line 02 be written to ensure that x evaluates to 6 in the line below?

Let x = calculate (8);

Show Suggested Answer Hide Answer
Suggested Answer: B

Contribute your Thoughts:

Cyndy
10 days ago
I agree, Option D is the clear winner. Using 'Number()' is the best way to convert the expression to a numeric value before the division.
upvoted 0 times
...
Quiana
11 days ago
Haha, 'Integer(num +10) /3' - that's just asking for trouble! Definitely go with D, the 'Number()' function is the way to go here.
upvoted 0 times
Alexis
4 days ago
I agree, D is the correct option. Using the 'Number()' function ensures the correct evaluation.
upvoted 0 times
...
...
Halina
21 days ago
I agree with Cherry, D seems like the correct answer.
upvoted 0 times
...
Alpha
24 days ago
I'm not sure about the other options, but D seems the most straightforward way to ensure the result is a number. The 'Number()' function should do the trick.
upvoted 0 times
...
Stephaine
27 days ago
Option D looks good to me. It seems to directly apply the 'Number()' function to the expression 'num + 10' before dividing by 3.
upvoted 0 times
Colette
22 hours ago
I agree, option D looks like the right choice.
upvoted 0 times
...
Marjory
10 days ago
I think option D is the correct one.
upvoted 0 times
...
...
Cherry
1 months ago
Because we need to ensure that the result is a number, so we should use Number() to convert it.
upvoted 0 times
...
Merlyn
1 months ago
Why do you think so, Cherry?
upvoted 0 times
...
Cherry
1 months ago
I think the answer is D.
upvoted 0 times
...

Save Cancel