JavaScript-Developer-I Practice Questions
Salesforce Certified JavaScript Developer (JS-Dev-101)
Last Update 1 day ago
Total Questions : 147
Dive into our fully updated and stable JavaScript-Developer-I practice test platform, featuring all the latest Salesforce Developer exam questions added this week. Our preparation tool is more than just a Salesforce study aid; it's a strategic advantage.
Our free Salesforce Developer practice questions crafted to reflect the domains and difficulty of the actual exam. The detailed rationales explain the 'why' behind each answer, reinforcing key concepts about JavaScript-Developer-I. Use this test to pinpoint which areas you need to focus your study on.
Refer to the code below:
< html >
< body >
< div id= " logo " > Hello Logo! < /div >
< button id= " test " > Click me < /button >
< /body >
< script >
function printMessage(event) {
console.log( ' This is a test message ' );
}
let el = document.getElementById( ' test ' );
el.addEventListener( " click " , printMessage, false);
< /script >
< /html >
Which action should be done?
function myFunction() {
a = a + b;
var b = 1;
}
myFunction();
console.log(a);
console.log(b);
Which statement is correct?
Refer to the code below:
01 < html lang= " en " >
02 < table onclick= " console.log( ' Table log ' ); " >
03 < tr id= " row1 " >
04 < td > Click me! < /td >
05 < /tr >
06 < /table >
07 < script >
08 function printMessage(event) {
09 console.log( ' Row log ' );
10 event.stopPropagation();
11 }
12
13 let elem = document.getElementById( ' row1 ' );
14 elem.addEventListener( ' click ' , printMessage, false);
15 < /script >
16 < /html >
Which code change should be done for the console to log the following when " Click me! " is clicked?
Row log
Table log
A developer has a fizzbuzz function that, when passed in a number, returns the following:
' fizz ' if the number is divisible by 3.
' buzz ' if the number is divisible by 5.
' fizzbuzz ' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither 3 nor 5.
Which two test cases properly test scenarios for the fizzbuzz function?
A developer wrote the following code:
01 let x = object.value;
02
03 try {
04 handleObjectValue(x);
05 } catch(error) {
06 handleError(error);
07 }
The developer has a getNextValue function to execute after handleObjectValue(), but does not want to execute getNextValue() if an error occurs. How can the developer change the code to ensure this behavior?
Refer to the code declarations below:
let str1 = ' Java ' ;
let str2 = ' Script ' ;
Which three expressions return the string JavaScript?
A developer has two ways to write a function:
Option A:
01 function Monster() {
02 this.growl = () = > {
03 console.log( " Grr! " );
04 }
05 }
Option B:
01 function Monster() {};
02 Monster.prototype.growl = () = > {
03 console.log( " Grr! " );
04 }
After deciding on an option, the developer creates 1000 monster objects. How many growl methods are created with Option A and Option B?
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 " Leo " to " The Lion " ?
Which three browser specific APIs are available for developers to persist data between page loads?
