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
25 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
26 days ago
Aha, Option D looks like the winner! Currying is the way to go here, nice and concise.
upvoted 0 times
...
Elly
28 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
Aileen
11 days ago
D) const addBY = (num1) => (num2) => num1 + num2;
upvoted 0 times
...
Ronny
18 days ago
A) const addBy = function(num1){\nreturn function(num2){\nreturn num1 + num2;\n}
upvoted 0 times
...
...
Lettie
1 months ago
Option B is a no-go, it's missing a parameter. How can we add without a second number?
upvoted 0 times
Lenita
17 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
20 days ago
C) const addBy = (num1) => num1 + num2 ;
upvoted 0 times
...
Armando
26 days ago
A) const addBy = function(num1){\nreturn function(num2){\nreturn num1 + num2;\n}
upvoted 0 times
...
...
Hannah
2 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
Lisha
14 days ago
It's a matter of preference, some developers prefer nested functions for clarity.
upvoted 0 times
...
Jenelle
23 days ago
Nested functions can help with code organization and readability.
upvoted 0 times
...
Irene
1 months ago
Option A is more flexible and allows for currying, which can be useful in certain situations.
upvoted 0 times
...
...
Sage
2 months ago
I think option A and D are correct because they both return a function that adds two numbers.
upvoted 0 times
...
Cordelia
2 months ago
I'm not sure, but I think option B and C might work too.
upvoted 0 times
...
Chantell
2 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
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