Latest [May 23, 2024] JavaScript-Developer-I Exam with Accurate Salesforce Certified JavaScript Developer I Exam PDF Questions [Q49-Q67]

Share

Latest [May 23, 2024] JavaScript-Developer-I Exam with Accurate Salesforce Certified JavaScript Developer I Exam PDF Questions

Take a Leap Forward in Your Career by Earning Salesforce 223 Questions


Salesforce JavaScript-Developer-I Certification Exam consists of 60 multiple-choice questions and is a timed exam that lasts for 105 minutes. JavaScript-Developer-I exam is administered by Salesforce and can be taken either online or at a testing center. To be eligible for the exam, you must have completed the JavaScript Development on the Salesforce Platform course or have equivalent knowledge and experience. Upon passing the exam, you will earn the Salesforce Certified JavaScript Developer I certification, which is a valuable credential for developers looking to advance their careers in Salesforce development.

 

NEW QUESTION # 49
is below:
<input type="file" onchange="previewFile()">
<img src="" height="200" alt="Image Preview..."/>
The JavaScript portion is:
01 function previewFile(){
02 const preview = document.querySelector('img');
03 const file = document.querySelector('input[type=file]').files[0];
04 //line 4 code
05 reader.addEventListener("load", () => {
06 preview.src = reader.result;
07 },false);
08 //line 8 code
09 }
In lines 04 and 08, which code allows the user to select an image from their local
computer , and to display the image in the browser?

  • A. 04 const reader = new FileReader();
    08 if (file) reader.readAsDataURL(file);
  • B. 04 const reader = new FileReader();
    08 if (file) URL.createObjectURL(file);
  • C. 04 const reader = new File();
    08 if (file) URL.createObjectURL(file);
  • D. 04 const reader = new File();
    08 if (file) reader.readAsDataURL(file);

Answer: A


NEW QUESTION # 50
Refer to the HTML below:

Which JavaScript statement results in changing ''Tony'' to ''Mr. T. ''?

  • A. Document.querySelector (''#main li:nth-child (2) ') , innerHTML = 'Mr . T ';
  • B. Document.querySelectorAll ( '#main li, Tony ' ) innerHTNL = Mr, T , ' ;
  • C. Document.querySelectorAll ('#main # TONY ') , innerHTML = Mr, T , ' ;
  • D. Document.querySelector (' '#main li:second-child') innerHTML, = Mr, T, ';

Answer: C


NEW QUESTION # 51
Refer to the code declarations below:

Which three expressions return the string JavaScript?
Choose 3 answers

  • A. Concat (str1, str2);
  • B. Str1 + str2;
  • C. Str1.join (str2);
  • D. $(str1) $ (str2} ';
  • E. Str1.concat (str2);

Answer: B,D,E


NEW QUESTION # 52
Given the code below:
Setcurrent URL ();
console.log('The current URL is: ' +url );
function setCurrentUrl() {
Url = window.location.href:
What happens when the code executes?

  • A. The url variable has global scope and line 02 executes correctly.
  • B. The url variable has local scope and line 02 executes correctly.
  • C. The url variable has local scope and line 02 throws an error.
  • D. The url variable has global scope and line 02 throws an error.

Answer: A


NEW QUESTION # 53
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?

  • A. console.timeStamp ()
  • B. console.trace()
  • C. console.getTime ()
  • D. console. timeLog ()

Answer: D


NEW QUESTION # 54
Refer to the code below:
<html lang="en">
<table onclick="console.log(Table log');">
<tr id="row1">
<td>Click me!</td>
</tr>
<table>
<script>
function printMessage(event) {
console.log('Row log');
}
Let elem = document.getElementById('row1');
elem.addEventListener('click', printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Row log when 'Click me! ' is
clicked?

  • A. Add event.removeEventListener(); toprintMessage function.
  • B. Add.event.stopPropagation(); to window.onLoad event handler.
  • C. Add event.removeEventListener(); to window.onLoad event handler.
  • D. Add event.stopPropagation(); to printMessage function.

Answer: D


NEW QUESTION # 55
Refer to the code below:

Which assertion accurately tests the above code?

  • A. Console, assert ( await functionalUnderTest (true) , 'not ok' )
  • B. Console, assert ( await functionalUnderTest (true) , 'ok
  • C. Console, assert (functionalUnderTest (true) , 'ok')
  • D. Console, assert ( await functionalUnderTest (true) , 'not ok) )

Answer: C


NEW QUESTION # 56
Which function should a developer use to repeatedly execute code at a fixed time interval?

  • A. setInterval
  • B. setPeriod
  • C. setInterim
  • D. setTimeout

Answer: A


NEW QUESTION # 57
Universal Containers (UC) notices that its application that allows users to search for
accounts makes a network request each time a key is pressed. This results in too many
requests for the server to handle.
● Address this problem, UC decides to implement a debounce function on string change
handler.
What are three key steps to implement this debounce function?
Choose 3 answers:

  • A. If there is an existing setTimeout and the search string changes, cancel the existing
    setTimeout using the persisted timerId and replace it with a new setTimeout.
  • B. If there is an existing setTimeout and the search string change, allow the existing
    setTimeout to finish, and do not enqueue a new setTimeout.
  • C. Store the timeId of the setTimeout last enqueued by the search string change handle.
  • D. When the search string changes, enqueue the request within a setTimeout.
  • E. Ensure that the network request has the property debounce set to true.

Answer: B,D,E


NEW QUESTION # 58
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from '/path/PrincePrettyPrint. Js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint modules for this import to work?

  • A. printPrice must be an all export
  • B. printPrice must be an default export
  • C. printPrice must be a multi export
  • D. printPrice must be named export

Answer: D


NEW QUESTION # 59
Refer to the following code block:
class Animal{
constructor(name){
this.name = name;
}
makeSound(){
console.log(`${this.name} is making a sound.`)
}
}
class Dog extends Animal{
constructor(name){
super(name)
this.name = name;
}
makeSound(){
console.log(`${this.name} is barking.`)
}
}
let myDog = new Dog('Puppy');
myDog.makeSound();
What is the console output?

  • A. Puppy is barking

Answer: A


NEW QUESTION # 60
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 this new requirement?

  • A. deliveryDate.date = Date.current () + 9;
  • B. deliveryDate.setDate( Date.current () + 9);
  • C. deliveryDate.date = new Date(+9) ;
  • D. deliveryDate.setDate(( new Date ( )).getDate () +9);

Answer: D


NEW QUESTION # 61
In the browser, the window object is often used to assign variables that require the broadcast scope in an application Node is application do not have access to the window object by default.
Which two methods are used to address this? Choose 2 answer

  • A. Create a new window object in the root file.
  • B. Assign variables to module, exports and require them as needed.
  • C. Assign variables to the global object.
  • D. Use the document instead of the window object.

Answer: A,D


NEW QUESTION # 62
Which option is a core Node,js module?

  • A. locate
  • B. Memory
  • C. Path
  • D. Ios

Answer: C


NEW QUESTION # 63
A developer at Universal Containers is creating their new landing page basedon HTML, CSS, and JavaScript.
To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage is fully loaded (HTML content and all related files), in order to do some custom initializations.
Which implementation should be used to call Fe:s:-a;::eHec5;te::.-.ter.: based on the business requirement above?

  • A. Add a handler to the personalizeWebsiteContent script to handlethe load event
  • B. Add a listener to the window object to handle the lead event
  • C. Add a listener to thewindow object to handle the DOMContentLoaded event
  • D. Add a handler to the personalizeWebsiteContent script tohandle the DOMContentLoaded event

Answer: B


NEW QUESTION # 64
Refer to the following code:

What is the output of line 11?

  • A. ["bar", "foo"]
  • B. ["foo:1", "bar:2"]
  • C. ["foo", "bar"]
  • D. [1,2]

Answer: C


NEW QUESTION # 65
Given the HTML below:

Which statement adds the priority-account css class to the Applied Shipping row?

  • A. document.querySelector('#row-as').classList.add('priority-account');

Answer: A


NEW QUESTION # 66
A developer publishes a new version of a package with new feature that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number be?

  • A. 1.2.3
  • B. 2.0.0
  • C. 1.2.0
  • D. 1.1.4

Answer: C


NEW QUESTION # 67
......

Authentic Best resources for JavaScript-Developer-I Online Practice Exam: https://www.verifieddumps.com/JavaScript-Developer-I-valid-exam-braindumps.html

Practice To JavaScript-Developer-I - VerifiedDumps Remarkable Practice On your Salesforce Certified JavaScript Developer I Exam Exam: https://drive.google.com/open?id=1LDfyidbaF5TdYBMRRC1ejW7rHuFjdj3x