Salesforce JavaScript Developer I Practice Exams
Last updated on Nov 16,2026- Exam Code: JavaScript Developer I
- Exam Name: Salesforce Certified JavaScript Developer I
- Certification Provider: Salesforce
- Latest update: Nov 16,2026
A developer wants to use a module called DataPrettyPrint. This module exports one default functioncalled printDate ().
How can a developer import and use the printDate() function?
A)
![]()
B)
![]()
C)
![]()
D)
![]()
- A . Option A
- B . Option B
- C . Option C
- D . Option D
Which option is a core Node,js module?
- A . Path
- B . Ios
- C . Memory
- D . locate
Refer to the following array:
Let arr1 = [ 1,2, 3, 4, 5 ];

Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?
- A . Let arr2 = arr1.slice(0, 5);
- B . Let arr2 = Array.from(arr1);
- C . Let arr2 = arr1;
- D . Let arr2 = arr1.sort();
Universal Containers recently launched its new landing page to host a crowd-funding campaign. The page uses an external library to display some third-party ads.
Once the page is fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the one in the code below:
![]()
All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
- A . Use the DOM inspector to prevent the load event to be fired.
- B . Use the browser to execute a script that removes all the element containing the class ad-library-item.
- C . Use the DOM inspector to remove all the elements containing the class ad-library-item.
- D . Use the browser console to execute a script that prevents the load event to be fired.
At Universal Containers, every team has its own way of copyingJavaScript objects. The code snippet shows an Implementation from one team:

What is the output of the code execution?
- A . Hello John Doe
- B . Hello Dan
- C . Hello Dan Doe
- D . SyntaxError: Unexpected token in JSON
Works in both the browser and Node.js.
Which meet the requirements?
- A . assert (number % 2 === 0);
- B . console.error(number % 2 === 0);
- C . console.debug(number % 2 === 0);
- D . console.assert(number % 2 === 0);
A developer needs to test this function:
01const sum3 = (arr) => (
02if (!arr.length) return 0,
03if (arr.length === 1) return arr[0],
04if (arr.length === 2) return arr[0]+ arr[1],
05 return arr[0] + arr[1] + arr[2],
06 );
Which two assert statements are valid tests for the function?
Choose 2 answers
- A . console.assert(sum3(1, ‘2’)) == 12);
- B . console.assert(sum3(0)) == 0);
- C . console.assert(sum3(-3, 2 )) == -1);
- D . console.assert(sum3(‘hello’, 2, 3, 4)) === NaN);
Refer of the string below:
Const str = ‘sa;esforce’=;
Which two statement result in the word ‘Sale’?
Choose 2 answers
- A . str, substring(0,5) ;
- B . str, substr(0,5) ;
- C . str, substring(1,5) ;
- D . str, substr(1,5) ;
Refer to the following object.

How can a developer access the full Name property for dog?
- A . Dog.fullName
- B . Dog.fullName ()
- C . Dog, get,fullName
- D . Dog, function, fullName
A developer writers the code below to calculate the factorial of a given number.
Function factorial(number) {
Return number + factorial(number -1);
}
factorial(3);
What is the resultof executing line 04?
- A . 0
- B . 6
- C . -Infinity
- D . RuntimeError