Official Bank 0/149

Salesforce Certified JavaScript Developer Exam (JS-Dev-101) - Salesforce Exam Questions

Last updated on June 20, 2026

97% Exam Compliance
149 Total Questions
1
Question
Code:
01 const sayHello = (name) => {
02 console.log('Hello ', name);
03 };
04
05 const world = () => {
06 return 'World';
07 };
08
09 sayHello(world);
This does not print "Hello World".

What change is needed?
Options
A Change line 2 to console.log('Hello', name());
B Change line 5 to function world() {
C Change line 7 to }();
D Change line 9 to sayHello(world)();
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

2
Question
for (let number = 2; number <= 5; number += 1) {
// faster code statement here
}
false?
Options
A console.classy(number + 2 === 0);
B console.error(number + 2 === 0);
C console.assert(number + 2 === 0);
D assert(number + 2 === 0);
Which statement meets the requirements to log an error when the Boolean statement evaluates to
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

3
Question
Refer to the code below:
01 const myFunction = arr => {
02 return arr.reduce((result, current) => {
03 return result + current;
04 }, 10);
05 }

What is the output of this function when called with an empty array?
Options
A Returns 0
B Returns 5 ← (Text here appears to be a typo; correct value is 10, see explanation.)
C Throws an error
D Returns NaN
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

4
Question
Given two expressions var1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is data type string?
Select 2
Options
A String(var1).concat(var2)
B var1.toString() + var2.toString()
C var1 + var2
D String.concat(var1 + var2)
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

5
Question
Which two code snippets show working examples of a recursive function?
Select 2
Options
A const sumToTen = numVar => {
if (numVar < 0)
return;
return sumToTen(numVar + 1);
};
B let countingDown = function(startNumber) {
if (startNumber > 0) {
console.log(startNumber);
return countingDown(startNumber - 1);
} else {
return startNumber;
}
};
(Note: Option D is shown here with corrected syntax: lowercase return and matching parentheses.)
C const factorial = numVar => {
if (numVar < 0) return;
if (numVar === 0) return 1;
return numVar * factorial(numVar - 1);
};
D function factorial(numVar) {
if (numVar < 0) return;
if (numVar === 0) return 1;
return numVar - 1;
}
Discussion (0 comments)

to join the discussion

Community Discussion

No discussions yet. Be the first to ask!

Finish Practice?

Are you sure you want to finish? This will end your practice session.