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
Which statement is true when comparing `==` and `===` in JavaScript?
- A . Both compare values and types.
- B . `==` compares types, `===` compares values.
- C . `==` compares values, `===` compares both values and types.
- D . There is no difference.
Which statement can a developer apply to increment the browser’s navigation history without a page refresh?
- A . window.history.pushState(newStateObject);
- B . window.history.pushStare(newStateObject, ‘ ‘, null);
- C . window.history.replaceState(newStateObject,”, null);
- D . window.history.state.push(newStateObject);
Refer to the string below.
Const str=’Salesforce’;
Which two statements results in the word ‘Sales’?
Str.substr(0,5);
Refer to the HTML below:
<div id=”main”>
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing “ Tony” to “Mr. T.”?
- A . document.querySelectorAll(‘$main $TONY’).innerHTML = ’ Mr. T. ’;
- B . document.querySelector(‘$main li:second-child’).innerHTML = ’ Mr. T. ’;
- C . document.querySelector(‘$main li.Tony’).innerHTML = ’ Mr. T. ’;
- D . document.querySelector(‘$main li:nth-child(2)’),innerHTML =’ Mr. T. ’;
Refer to the HTML below:
<div id=”main”>
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing “ Tony” to “Mr. T.”?
- A . document.querySelectorAll(‘$main $TONY’).innerHTML = ’ Mr. T. ’;
- B . document.querySelector(‘$main li:second-child’).innerHTML = ’ Mr. T. ’;
- C . document.querySelector(‘$main li.Tony’).innerHTML = ’ Mr. T. ’;
- D . document.querySelector(‘$main li:nth-child(2)’),innerHTML =’ Mr. T. ’;
Refer to HTML below:
<div id =”main”>
<div id = “ card-00”>This card is smaller.</div>
<div id = “card-01”>
The width and height of this card is determined by its contents.
</div>
</div>
Which expression outputs the screen width of the element with the ID card-01?
- A . document.getElementById(‘ card-01 ’).getBoundingClientRest().width
- B . document.getElementById(‘ card-01 ’).style.width
- C . document.getElementById(‘ card-01 ’).width
- D . document.getElementById(‘ card-01 ’).innerHTML.lenght*e
A test has a dependency on database. query. During the test, the dependency is replaced with an object called database with the method, Calculator query, that returns an array. The developer does not need to verify how many times the method has been called.
Which two test approaches describe the requirement? Choose 2 answers
- A . White box
- B . Stubbing
- C . Black box
- D . Substitution
Given the code below:
Setcurrent URL ();
console.log(‘The current URL is: ‘ +url );
functionsetCurrentUrl() {
Url = window.location.href:
What happens when the code executes?
- A . The url variable has local scope and line 02 throws an error.
- B . The url variable has global scope and line 02 executes correctly.
- C . The url variable has global scope and line 02 throws an error.
- D . The url variable has local scope and line 02 executes correctly.
Refer to the code below:
Const searchTest = ‘Yay! Salesforce is amazing!” ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?
- A . > true > false
- B . > 5 >undefined
- C . >5>-1
- D . >5>0
Given the code below:
const copy = JSON.stringify([ newString(‘ false ’), new Bollean( false ), undefined ]);
What is the value of copy?
- A . — [ ”false”, { } ]–
- B . — [ false, { } ]–
- C . — [ ”false”, false, undefined ]–
- D . — [ ”false”,false, null ]–