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

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 84
Topic #: 2
[All 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
4 months 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
4 months ago
Aha, Option D looks like the winner! Currying is the way to go here, nice and concise.
upvoted 0 times
...
Elly
4 months 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
3 months ago
D) const addBY = (num1) => (num2) => num1 + num2;
upvoted 0 times
...
Ronny
4 months ago
A) const addBy = function(num1){\nreturn function(num2){\nreturn num1 + num2;\n}
upvoted 0 times
...
...
Lettie
4 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
4 months ago
Yeah, option B is definitely not the right choice. We need that second parameter to add the numbers together.
upvoted 0 times
...
Carlota
4 months ago
C) const addBy = (num1) => num1 + num2 ;
upvoted 0 times
...
Armando
4 months ago
A) const addBy = function(num1){\nreturn function(num2){\nreturn num1 + num2;\n}
upvoted 0 times
...
...
Hannah
5 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
4 months ago
It's a matter of preference, some developers prefer nested functions for clarity.
upvoted 0 times
...
Jenelle
4 months ago
Nested functions can help with code organization and readability.
upvoted 0 times
...
Irene
4 months ago
Option A is more flexible and allows for currying, which can be useful in certain situations.
upvoted 0 times
...
...
Sage
5 months ago
I think option A and D are correct because they both return a function that adds two numbers.
upvoted 0 times
...
Cordelia
5 months ago
I'm not sure, but I think option B and C might work too.
upvoted 0 times
...
Chantell
5 months ago
I agree with Annett, option A and D both return the sum of two numbers.
upvoted 0 times
...
Annett
5 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