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 2 Question 84 Discussion

Actual exam question for Salesforce's Salesforce Certified JavaScript Developer I exam
Question #: 84
Topic #: 2
[All Salesforce Certified JavaScript Developer I Questions]

Refer to the code below:

const addBy = ?

const addByEight =addBy(8);

const sum = addBYEight(50);

Which two functions can replace line 01 and return 58 to sum?

Choose 2 answers

Show Suggested Answer Hide Answer
Suggested Answer: A, D

Contribute your Thoughts:

Lou
11 days ago
I'm hungry just looking at this code. I wonder if there's a function that can add some snacks to the mix?
upvoted 0 times
...
Emile
12 days ago
Aha, Option D looks like the winner! Currying is the way to go here, nice and concise.
upvoted 0 times
...
Elly
14 days ago
Option C is interesting, but I'm not sure about the use of 'num2' when it's not defined. Hmm, curious.
upvoted 0 times
Ronny
4 days ago
A) const addBy = function(num1){\nreturn function(num2){\nreturn num1 + num2;\n}
upvoted 0 times
...
...
Lettie
19 days ago
Option B is a no-go, it's missing a parameter. How can we add without a second number?
upvoted 0 times
Lenita
3 days ago
Yeah, option B is definitely not the right choice. We need that second parameter to add the numbers together.
upvoted 0 times
...
Carlota
6 days ago
C) const addBy = (num1) => num1 + num2 ;
upvoted 0 times
...
Armando
12 days ago
A) const addBy = function(num1){\nreturn function(num2){\nreturn num1 + num2;\n}
upvoted 0 times
...
...
Hannah
1 months ago
Option A looks good, but why do we need a nested function? Seems a bit overkill for such a simple task.
upvoted 0 times
Jenelle
9 days ago
Nested functions can help with code organization and readability.
upvoted 0 times
...
Irene
24 days ago
Option A is more flexible and allows for currying, which can be useful in certain situations.
upvoted 0 times
...
...
Sage
1 months ago
I think option A and D are correct because they both return a function that adds two numbers.
upvoted 0 times
...
Cordelia
1 months ago
I'm not sure, but I think option B and C might work too.
upvoted 0 times
...
Chantell
1 months ago
I agree with Annett, option A and D both return the sum of two numbers.
upvoted 0 times
...
Annett
2 months ago
I think option A and D can replace line 01.
upvoted 0 times
...

Save Cancel