Update JavaScript-Developer-I Free Samples For Salesforce Certified JavaScript Developer I Certification

It is impossible to pass Salesforce JavaScript-Developer-I exam without any help in the short term. Come to Examcollection soon and find the most advanced, correct and guaranteed Salesforce JavaScript-Developer-I practice questions. You will get a surprising result by our Latest Salesforce Certified JavaScript Developer I practice guides.

Also have JavaScript-Developer-I free dumps questions for you:

Refer to the code below:
Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” =>
Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”) Promise.race(( car1, car2, car3))
.t hen (value => (
Let result = ‘$(value) the race.’;)}
.catch(arr => {
console.log(“Race is cancelled.”, err);
What isthe value of result when Promise.race executes?

  • A. Car 3 completes the race
  • B. Car 2 completed the race.
  • C. Car 1 crashed in the race.
  • D. Race is cancelled.

Answer: B

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:
JavaScript-Developer-I dumps exhibit
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.

Answer: B

At Universal Containers, every team has its own way of copyingJavaScript objects. The code
Snippet shows an implementation from one team:
JavaScript-Developer-I dumps exhibit
What is the Output of the code execution?

  • A. Hello Dan Doe
  • B. Hello John DOe
  • C. TypeError: dan.name is not a function
  • D. TypeError: Assignment to constant variable.

Answer: C

Refer to HTML below:
<p> The current status of an Order: <span id =”status”> In Progress </span> </p>.
Which JavaScript statement changes the text ‘In Progress’ to ‘Completed’ ?

  • A. document.getElementById(“status”).Value = ’Completed’ ;
  • B. document.getElementById(“#status”).innerHTML = ’Completed’ ;
  • C. document.getElementById(“status”).innerHTML = ’Completed’ ;
  • D. document.getElementById(“.status”).innerHTML = ’Completed’ ;

Answer: C

Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data typeBoolean ?
Choose 2 answers:

  • A. Boolean(var1 && var2)
  • B. var1 && var2
  • C. var1.toBoolean() && var2toBoolean()
  • D. Boolean(var1) && Boolean(var2)

Answer: AD

A developer is debugging a web server that uses Node.js The server hits a runtimeerror every third request to an important endpoint on the web server.
The developer added a break point to the start script, that is at index.js at he root of the server’s source code. The developer wants to make use of chrome DevTools to debug. Which command can be run to access DevTools and make sure the breakdown is hit ?

  • A. node -i index.js
  • B. Node --inspect-brk index.js
  • C. Node inspect index.js
  • D. Node --inspect index.js

Answer: D

A developer wrote the following codeto test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in thearray.
JavaScript-Developer-I dumps exhibit
Which two results occur when running this test on the updated sum3 function? Choose 2 answers

  • A. The line 05 assertion passes.
  • B. The line 02 assertion passes.
  • C. The line 02 assertion fails.
  • D. The line 05 assertion fails.

Answer: BD

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’)

Answer: D

A developer wrote 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. Emptystring if the number is divisible by neither 3 or 5.
Which two test cases will properly test scenarios for the fizzbuzz function? Choose 2 answers

  • A. let res = fizzbuzz(5); console.assert ( res === ‘ ’ );
  • B. let res = fizzbuzz(15);console.assert ( res ===‘ fizzbuzz ’ )
  • C. let res = fizzbuzz(Infinity); console.assert ( res === ‘ ’ )
  • D. let res = fizzbuzz(3); console.assert ( res === ‘ buzz ’ )

Answer: BCD

Given the following code: document.body.addEventListener(‘ click ’, (event) => { if (/* CODE REPLACEMENT HERE */) {
console.log(‘button clicked!’);
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?

  • A. Event.clicked
  • B. e.nodeTarget ==this
  • C. event.target.nodeName == ‘BUTTON’
  • D. button.addEventListener(‘click’)

Answer: C

Refer to the code:
JavaScript-Developer-I dumps exhibit
Given the code above, which three properties are set pet1? Choose 3answers:

  • A. Name
  • B. canTalk
  • C. Type
  • D. Owner
  • E. Size

Answer: BCE

The developer wants to test this code:
Const toNumber =(strOrNum) => strOrNum; Which two tests are most accurate for this code? Choose 2 answers

  • A. console.assert(toNumber(‘2’) ===2);
  • B. console.assert(Number.isNaN(toNumber()));
  • C. console.assert(toNumber(‘-3’) < 0);
  • D. console.assert(toNumber () === NaN);

Answer: AC

In which situation should a developer include a try .. catch block around their function call ?

  • A. The function has an error that shouldnot be silenced.
  • B. The function results in an out of memory issue.
  • C. The function might raise a runtime error that needs to be handled.
  • D. The function contains scheduled code.

Answer: C

A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = ‘July’; const year = 2019;
if(year === 2019) { monthName = ‘June’;
Which line edit should be made to make this code run?

  • A. 01 let monthName =’July’;
  • B. 02 let year =2019;
  • C. 02 const year = 2020;
  • D. 03 if (year == 2019) {

Answer: A

Given code below: setTimeout (() => ( console.log(1);
). 0);
New Promise ((resolve, reject )) = > ( setTimeout(() => ( reject(console.log(3));
). 1000);
)).catch(() => ( console.log(4);
What is logged to the console?

  • A. 2 1 4 3 5
  • B. 2 5 13 4
  • C. 1 2 4 3 5
  • D. 1 2 5 3 4

Answer: B

Refer to the HTML below:
<div id=”main”>
Which JavaScript statementresults in changing “ Tony” to “Mr. T.”?

  • A. document.querySelectorAll(‘$main $TONY’).innerHTML = ’ M
  • B. ’;
  • C. document.querySelector(‘$main li:second-child’).innerHTML = ’ M
  • D. ’;
  • E. document.querySelector(‘$main li.Tony’).innerHTML = ’ M
  • F. ’;
  • G. document.querySelector(‘$main li:nth-child(2)’),innerHTML = ’ M
  • H. ’;

Answer: D

A developer creates a simple webpage with an input field. Whena 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 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.addEventListener(“onclick”, function() {
  • D. Replace line 02 with button.addCallback(“click”, function() {

Answer: A

Refer to code below:
Const objBook = { Title: ‘Javascript’,
Object.preventExtensions(objBook); ConstnewObjBook = objBook; newObjectBook.author = ‘Robert’;
What are the values of objBook and newObjBook respectively ?

  • A. [title: “javaScript”] [title: “javaScript”]
  • B. {author: “Robert”, title: “javaScript} Undefined
  • C. {author: “Robert”, title: “javaScript}{author: “Robert”, title: “javaScript}
  • D. {author: “Robert”}{author: “Robert”, title: “javaScript}

Answer: A

A developer is required to write a function that calculates the sum of elements in an
array but is getting undefinedevery time the code is executed. The developer needs to find what is missing in the code below.
Const sumFunction = arr => {
Return arr.reduce((result, current) => {
Result += current;
), 10);
Which option makes the code work as expected?

  • A. Replace line 02 with return arr.map(( result, current) => (
  • B. Replace line 04 with result = result +current;
  • C. Replace line 03 with if(arr.length == 0 ) ( return 0; )
  • D. Replace line 05 with return result;

Answer: D

Refer to the following array: Let arr = [ 1,2, 3, 4, 5];
Which three options result in x evaluating as [3, 4, 5] ? Choose 3 answers.

  • A. Let x= arr.filter (( a) => (a<2));
  • B. Let x=arr.splice(2,3);
  • C. Let x= arr.slice(2);
  • D. Let x= arr.filter((a) => ( return a>2 ));
  • E. Let x = arr.slice(2,3);

Answer: BCD


https://www.dumps-files.com/files/JavaScript-Developer-I/ (157 New Questions)