| PDF + Test Engine |
|
||
| Test Engine |
|
||
|
|
Here are Salesforce Javascript-Developer-I PDF available features:
| 147 questions with answers | Updation Date : 16 Jul, 2026 |
| 1 day study required to pass exam | 100% Passing Assurance |
| 100% Money Back Guarantee | Free 3 Months Updates |
Refer to the code below: const event = new CustomEvent( //Missing Code ); obj.dispatchEvent(event); A developer needs to dispatch a custom event called update to send information about recordId. Which two options could a developer insert at the placeholder in line 02 to achieve this? Choose 2 answers
A. ‘Update’ , (recordId : ‘123abc’(
B. ‘Update’ , ‘123abc’
C. { type : ‘update’, recordId : ‘123abc’ }
D. ‘Update’ , { Details : { recordId : ‘123abc’ } }
A developer creates a simple webpage with an input field. When a user enters text in the input field and clicks the button, the actual value of the field must be displayed in the console. Here is the HTML file content: <input type =” text” value=”Hello” name =”input”> <button type =”button” >Display </button> The developer wrote the javascript code below: Const button= document.querySelector(‘button’); button.addEvenListener(‘click’, () => ( Const input = document.querySelector(‘input’); console.log(input.getAttribute(‘value’)); When the user clicks the button, the output is always “Hello”. What needs to be done to make this code work as expected?
A. Replace line 04 with console.log(input .value);
B. Replace line 03 with const input = document.getElementByName(‘input’);
C. Replace line 02 with button.addCallback(“click”, function() {
D. Replace line 02 withbutton.addEventListener(“onclick”, function() {
Refer to the following code: <html lang=”en”> <body> <div onclick = “console.log(‘Outer message’) ;”> <button id =”myButton”>CLick me<button> </div> </body> <script> function displayMessage(ev) { ev.stopPropagation(); console.log(‘Inner message.’); } const elem =document.getElementById(‘myButton’); elem.addEventListener(‘click’ , displayMessage); </script> </html> What will the console show when the button is clicked?
A. Outer message
B. Outer message Inner message
C. Inner message Outer message
D. Inner message
Refer to the code below: Async funct on functionUnderTest(isOK) { If (isOK) return ‘OK’ ; Throw new Error(‘not OK’); ) Which assertion accuretely tests the above code?
A. Console.assert (await functionUnderTest(true), ‘ OK ’)
B. Console.assert (await functionUnderTest(true), ‘ not OK ’)
C. Console.assert (awaitfunctionUnderTest(true), ‘ not OK ’)
D. Console.assert (await functionUnderTest(true), ‘OK’)
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 isthe result of executing line 04?
A. 0
B. 6
C. -Infinity
D. RuntimeError
Refer to the code below: 01 const server = require(‘server’); 02 /* Insert code here */ A developer imports a library that creates a web server.The imported library uses events and callbacks to start the servers Which code should be inserted at the line 03 to set up an event and start the web server ?
A. Server.start ();
B. server.on(‘ connect ’ , ( port) => { console.log(‘Listening on ’ , port);})
C. server()
D. serve(( port) => (
E. console.log( ‘Listening on ’, port) ;
A developer wants to iterate through an array of objects and count the objects and count the objects whose property value, name, starts with the letter N. Const arrObj = [{“name” : “Zach”} , {“name” : “Kate”},{“name” : “Alise”},{“name” : “Bob”},{“name” : “Natham”},{“name” : “nathaniel”} Refer to the code snippet below: 01 arrObj.reduce(( acc, curr) => { 02 //missing line 02 02 //missing line 03 04 ).0); Which missing lines 02 and 03 return the correct count?
A. Const sum = curr.startsWith(‘N’) ? 1: 0;Return acc +sum
B. Const sum = curr.name.startsWith(‘N’) ? 1: 0;Return acc +sum
C. Const sum = curr.startsWIth(‘N’) ? 1: 0;Return curr+ sum
D. Constsum = curr.name.startsWIth(‘N’) ? 1: 0;Return curr+ sum
What can the developer do to change the code to print “Hello World” ?
A. Changeline 7 to ) () ;
B. Change line 2 to console.log(‘Hello’ , name() );
C. Change line 9 to sayHello(world) ();
D. Change line 5 to function world ( ) {
Giventhe code below: const copy = JSON.stringify([ new String(‘ false ’), new Bollean( false ), undefined ]); What is the value of copy?
A. -- [ \”false\” , { } ]--
B. -- [ false, { } ]--
C. -- [ \”false\” , false, undefined ]--
D. -- [ \”false\” ,false, null ]--
A developer is working on an ecommerce website where the delivery date is dynamically calculated based on the current day. The code line below is responsible for this calculation. Const deliveryDate = new Date (); Due to changes in the business requirements, the delivery date must now be today’s date + 9 days. Which code meets thisnew requirement?
A. deliveryDate.setDate(( new Date ( )).getDate () +9);
B. deliveryDate.setDate( Date.current () + 9);
C. deliveryDate.date = new Date(+9) ;
D. deliveryDate.date = Date.current () + 9;