0% found this document useful (0 votes)
9K views17 pages

Aindump2go Javascript-Developer-I Simulations 2022-Apr-03 by Robin 65q Vce

This document provides a summary of 10 sample questions from the Salesforce Certified JavaScript Developer I exam along with their answers. It encourages developers to download the latest practice questions for the exam from a given URL. The practice questions cover topics like JavaScript fundamentals, asynchronous programming, testing JavaScript code, and using modules in JavaScript.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9K views17 pages

Aindump2go Javascript-Developer-I Simulations 2022-Apr-03 by Robin 65q Vce

This document provides a summary of 10 sample questions from the Salesforce Certified JavaScript Developer I exam along with their answers. It encourages developers to download the latest practice questions for the exam from a given URL. The practice questions cover topics like JavaScript fundamentals, asynchronous programming, testing JavaScript code, and using modules in JavaScript.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps

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

Exam Questions JavaScript-Developer-I


Salesforce Certified JavaScript Developer I

https://www.2passeasy.com/dumps/JavaScript-Developer-I/

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

NEW QUESTION 1
Refer to the code below:

What value can a developer expect when referencing o.js.secondCity?

A. Undefined
B. ‘ new york ’
C. ‘ New York ’
D. An error

Answer: B

NEW QUESTION 2
A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.
What is the correct implementation of the try...catch?
A)

B)

C)

D)

A. Option
B. Option
C. Option
D. Option

Answer: A

NEW QUESTION 3
A developer creates an object where its properties should be immutable and prevent properties from being added or modified.
Which method shouldbe used to execute this business requirement ?

A. Object.const()
B. Object.eval()

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

C. Object.lock()
D. Object.freeze()

Answer: D

NEW QUESTION 4
Refer to the code:

Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?
A)

B)

C)

D)

A.

Answer: B

NEW QUESTION 5
developer is trying to convince management that their team will benefit from using

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

Node.js for a backend server that they are going to create. The server will be a web server that handles API requests from a website that the team has already
built using HTML, CSS, and JavaScript.
Which three benefits of Node.js can the developer use to persuade their manager? Choose 3 answers:

A. I nstalls with its own package manager toinstall and manage third-party libraries.
B. Ensures stability with one major release every few years.
C. Performs a static analysis on code before execution to look for runtime errors.
D. Executes server-side JavaScript code to avoid learning a new language.
E. User non blocking functionality for performant request handling .

Answer: ACE

NEW QUESTION 6
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

NEW QUESTION 7
A developer needs to test this function:
01const sum3 = (arr) => (
02if (!arr.length) return 0,
03if (arr.length === 1) return arr[0],
04if (arr.length === 2) return arr[0]+ arr[1],
05 return arr[0] + arr[1] + arr[2],
06 );
Which two assert statements are valid tests for the function? Choose 2 answers

A. console.assert(sum3(1, ‘2’)) == 12);


B. console.assert(sum3(0)) == 0);
C. console.assert(sum3(-3, 2 )) == -1);
D. console.assert(sum3(‘hello’, 2, 3, 4)) === NaN);

Answer: AC

NEW QUESTION 8
Refer to the HTML below:
<div id=”main”>
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
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

NEW QUESTION 9
Refer to the code below:
1 let car1 = new promise((_, reject) =>
2 setTimeout(reject, 2000, “Car 1 crashed in”));
3 let car2 = new Promise(resolve => setTimeout(resolve, 1500, “Car 2 completed”));
4 let car3 = new Promise(resolve => setTimeout (resolve, 3000, “Car 3 Completed”));
5 Promise.race([car1, car2, car3]) 06 .then(value => (
07 let result = $(value) the race. `; 08 ))
9 catch( arr => (

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

10 console.log(“Race is cancelled.”, err); 11 ));


What is the value of result when Promise.race executes?

A. Car 3 completed the race.


B. Car 1 crashed in the race.
C. Car 2 completed the race.
D. Race is cancelled.

Answer: C

NEW QUESTION 10
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
2 //missing line 03
04 ).0);
Which missing lines 02 and 03 return the correct count?

A. Mastered
B. Not Mastered

Answer: A

Explanation:
Explanation

NEW QUESTION 10
Which three actions can be using the JavaScript browser console? Choose 3 answers:

A. View and change DOM the page.


B. Display a report showing the performance of a page.
C. Run code that is not related to page.
D. view , change, and debug the JavaScript code of the page.
E. View and change security cookies.

Answer: ACD

NEW QUESTION 13
Refer to the code below:

Line 05 causes an error.


What are the values of greeting and salutation once code completes?

A. Greeting is Hello and salutation is Hello, Hello.


B. Greeting is Goodbye and salutation is Hello, Hello.
C. Greeting is Goodbye and salutation is I say Hello.
D. Greeting is Hello and salutation is I say hello.

Answer: A

NEW QUESTION 15
A developer wrote the following code: 01 let X = object.value;
02
3 try {
4 handleObjectValue(X); 05 } catch (error) {
6 handleError(error);
7}
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 thisbehavior?

A. 03 try{4 handleObjectValue(x);5 } catch(error){6 handleError(error); 07 } then {8 getNextValue();9 }


B. 03 try{4 handleObjectValue(x);5 } catch(error){6 handleError(error); 07 } finally {08 getNextValue();10 }
C. 03 try{04handleObjectValue(x); 05 } catch(error){6 handleError(error);7 }8 getNextValue();
D. 03 try {04 handleObjectValue(x)05 ……………………

Answer: D

NEW QUESTION 19

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

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 ]-

Answer: D

NEW QUESTION 23
Given the following code:

is the output of line 02?

A. ''x''
B. ''null'''
C. ''object''
D. ''undefined''

Answer: C

NEW QUESTION 25
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 notneed 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

Answer: AD

NEW QUESTION 29
Refer to the code below: Let textValue = ’1984’;
Which code assignment shows a correct way to convert this string to an integer?

A. let numberValue = Number(textValue);


B. Let numberValue = (Number)textValue;
C. Let numberValue = textValue.toInteger();
D. Let numberValue = Integer(textValue);

Answer: A

NEW QUESTION 32
A developer wants to use a module named universalContainersLib and then call functions from it.
How should a developer import every function from the module and then call the functions foo and bar?

A. import * from '/path/universalContainersLib.js'; universalContainersLi


B. foo ()7 universalContainersLib.bar ();
C. import {foo,bar} from '/path/universalCcontainersLib.js'; foo():bar()?
D. import all from '/path/universalContainersLib.js'; universalContainersLib.foo(); universalContainersLib.bar ();
E. import * as lib from '/path/universalContainersLib.js'; lib.foo();li
F. bar ();

Answer: D

NEW QUESTION 37
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/PricePrettyPrint.js’;
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?

A. printPrice must be be a named export


B. printPrice must be an all export
C. printPrice must be the default export
D. printPrice must be a multi exportc

Answer: C

NEW QUESTION 40
Refer to the code below:

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

Which two statements correctly execute the runParallel () function? Choose 2 answers

A. Async runParallel () .then(data);


B. runParallel ( ). done(function(data){ return data;});
C. runParallel () .then(data);
D. runParallel () .then(function(data) return data

Answer: BD

NEW QUESTION 43
Refer to code below:

What is displayed when the code executes?

A. ReferenceError: b is not defined


B. a
C. Undefined
D. Null

Answer: C

Explanation:

NEW QUESTION 47
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, UCdecides 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 change, allow the existingsetTimeout to finish,and do not enqueue a new setTimeout.
B. When the search string changes, enqueue the request within a setTimeout.

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

C. Ensure that the network request has the property debounce set to true.
D. 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.
E. Store the timeId of the setTimeout last enqueued by the search string change handle.

Answer: ABC

NEW QUESTION 48
Given the following code: Let x =(‘15’ + 10)*2;
What is the value of a?

A. 3020
B. 1520
C. 50
D. 35

Answer: A

NEW QUESTION 53
Given HTML below:

Which statement adds the priority = account CSS class to the universal COntainers row ?

A. Document.querySelector(‘#row-uc’).classes.push(‘priority-account’);
B. Document .queryElementById(‘row-uc’).addclass(‘priority-account’);
C. Document .querySelector(‘#row-uc’).classList.add(‘priority-account’);
D. Document .querySelectorALL(‘#row-uc’).classList.add(‘priority-account’);

Answer: B

NEW QUESTION 55
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:

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

NEW QUESTION 57
Refer to the code below: function changeValue(param) { Param =5;
}
Let a =10;
Let b =5; changeValue(b);
Const result = a+ “ - ”+ b;
What is the value of result when code executes?

A. 10 -10
B. 5 -5
C. 5 - 10
D. 10 - 5

Answer: A

NEW QUESTION 62
Refer to the following code:

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

What is the output line 11?

A. [1,2]
B. [“bar”,”foo”]
C. [“foo”,”bar”]
D. [“foo:1”,”bar:2”]

Answer: C

NEW QUESTION 65
Refer to the code below:
Let foodMenu1 =[‘pizza’, ‘burger’, ‘French fries’]; Let finalMenu = foodMenu1; finalMenu.push(‘Garlic bread’);
What is the value of foodMenu1 after the code executes?

A. [ ‘pizza’,’Burger’, ‘French fires’, ‘Garlic bread’]


B. [ ‘pizza’,’Burger’, ‘French fires’]
C. [ ‘Garlic bread’ , ‘pizza’,’Burger’, ‘French fires’ ]
D. [ ‘Garlic bread’]

Answer: B

NEW QUESTION 67
Refer to the code below:

What is the output of this function when called with an empty array?

A. Returns 0
B. Throws an error
C. Returns 10
D. Returns NaN

Answer: C

NEW QUESTION 68
developer creates a new web server that uses Node.js. It imports aserver library that uses events and callbacks for handling server functionality.
The server library is imported with require and is made available to the code by a
variable named server. The developer wants to log any issues that the server has while booting up.
Given the code and the information the developer has, which code logs an error at boost with an event?

A. Server.catch ((server) => { console.log(‘ERROR’, error);});


B. Server.error ((server) => { console.log(‘ERROR’, error);});
C. Server.on (‘error’, (error) => { console.log(‘ERROR’, error);});
D. Try{server.start();} catch(error) { console.log(‘ERROR’, error);}

Answer: C

NEW QUESTION 72
Refer to the code:

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

Given the code above, which three properties are set pet1? Choose 3answers:

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

Answer: BCE

NEW QUESTION 74
A developer has a formatName function that takes two arguments, firstName and lastName and returns a string. They want to schedule the
function to run once after five seconds.
What is the correct syntax to schedule this function?

A. setTimeout (formatName(), 5000, "John", "BDoe");


B. setTimeout (formatName('John', ‘'Doe'), 5000);
C. setTimout(() => { formatName("John', 'Doe') }, 5000);
D. setTimeout ('formatName', 5000, 'John", "Doe');

Answer: D

NEW QUESTION 76
Refer to code below:
Let productSKU = ‘8675309’ ;
A developer has a requirement to generate SKU numbers that are always 19 characters lon, starting with ‘sku’,and padded with zeros.
Which statement assigns the values sku0000000008675309 ?

A. productSKU = productSKU .padStart (19. ‘0’).padstart(‘sku’);


B. productSKU = productSKU .padEnd (16. ‘0’).padstart(‘sku’);
C. productSKU = productSKU .padEnd (16. ‘0’).padstart(19, ‘sku’);
D. productSKU = productSKU .padStart (16. ‘0’).padstart(19, ‘sku’);

Answer: D

NEW QUESTION 81
A developer has an ErrorHandler module that contains multiple functions. What kind of export be leverages sothat multiple functions can be used?

A. Named
B. All
C. Multi
D. Default

Answer: A

NEW QUESTION 82
The developer wants to test the array shown: const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ? Choose 2 answers:

A. console.assert( arr.length === 5 );


B. arr.forEach(elem => console.assert(elem === 0)) ;
C. console.assert(arr[0] === 0 && arr[ arr.length] === 0);
D. console.assert (arr.length >0);

Answer: AB

NEW QUESTION 83
Refer to the code below:

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

Why does the function bar have access to variable a ?

A. Inner function’s scope


B. Hoisting
C. Outer function’s scope
D. Prototype chain

Answer: C

NEW QUESTION 87
is below:
<input type=”file” onchange=”previewFile()”>
<img src=”” height=”200” alt=”Image Preview…”/> The JavaScript portion is:
1 function previewFile(){
2 const preview = document.querySelector(‘img’);
3 const file = document.querySelector(‘input[type=file]’).files[0]; 04 //line 4 code
05 reader.addEventListener(“load”, () =>{ 06 preview.src = reader.result;
7 },false);
8 //line 8 code
9}
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 File();08 if (file) URL.createObjectURL(file);


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

Answer: D

NEW QUESTION 89
Given the code below:

What should a developer insert at line 15 to output the following message using the method ?
> SNEGeneziz is loading a cartridgegame: Super Monic 3x Force . . .

A. Console16bit.prototype.load(gamename) = function() {
B. Console16bit.prototype.load = function(gamename) {
C. Console16bit = Object.create(GameConsole.prototype).load = function (gamename) {
D. Console16bit.prototype.load(gamename) {

Answer: B

NEW QUESTION 94
Refer to the code below:
new Promise((resolve, reject) => { const fraction = Math.random();
if( fraction >0.5) reject("fraction > 0.5, " + fraction); resolve(fraction);
})

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

.then(() =>console.log("resolved"))
.catch((error) => console.error(error))
.finally(() => console.log(" when am I called?"));

When does Promise.finally on line 08 get called?

A. When rejected
B. When resolved and settled
C. WHen resolved
D. When resolved or rejected

Answer: D

NEW QUESTION 96
Refer to the following code: 01 function Tiger(){
02 this.Type = ‘Cat’; 03 this.size = ‘large’; 04 }
05
06 let tony = new Tiger(); 07 tony.roar = () =>{
8 console.log(‘They\’re great1’);
9 };
10
11 function Lion(){ 12 this.type = ‘Cat’; 13this.size = ‘large’; 14 }
15
16 let leo = new Lion(); 17 //Insert code here
18 leo.roar();
Which two statements could be inserted at line 17 to enable the function call on line 18? Choose 2 answers.

A. Leo.roar = () => { console.log(‘They\’re pretty good:’); };


B. Object.assign(leo,Tiger);
C. Object.assign(leo,tony);
D. Leo.prototype.roar = () => { console.log(‘They\’re pretty good:’); };

Answer: AC

NEW QUESTION 99
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

NEW QUESTION 101

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

Refer to the following code:

What is returned by the function call on line 13?

A. Undefined
B. Line 13 throws an error.
C. ‘Undefined values!’
D. ‘Null value!’

Answer: A

NEW QUESTION 102


Refer to the code below:
Const resolveAfterMilliseconds = (ms) => Promise.resolve ( setTimeout (( => console.log(ms), ms ));
Const aPromise = await resolveAfterMilliseconds(500); Const bPromise = await resolveAfterMilliseconds(500); Await aPromise, wait bPromise;
What is the result of runningline 05?

A. aPromise and bPromise run sequentially.


B. Neither aPromise or bPromise runs.
C. aPromise and bPromise run in parallel.
D. Only aPromise runs.

Answer: B

NEW QUESTION 105


Which statement accurately describes the behaviour of the async/ await keyworks ?

A. The associated class contains some asynchronous functions.


B. The associated function will always return apromise
C. The associated function can only be called via asynchronous methods
D. The associated sometimes returns a promise.

Answer: B

NEW QUESTION 110


Refer to the following code that performs a basic mathematical operation on a provided input:
function calculate(num) { Return (num +10) / 3;
}
How should line 02 be written to ensure thatx evaluates to 6 in the line below? Let x = calculate (8);

A. Return Number((num +10) /3 );


B. Return (Number (num +10 ) / 3;
C. Return Integer(num +10) /3;
D. Return Number(num + 10) / 3;

Answer: B

NEW QUESTION 113


What are two unique features of functions defined with a fat arrow as compared to normal function definition?
Choose 2 answers

A. The function generated its own this making ituseful for separating the function’s scope from its enclosing scope.
B. The function receives an argument that is always in scope, called parentThis, which is the enclosing lexical scop
C. If the function has a single expression in the function body, the expression will be evaluated and implicit returned.
D. The function uses the this from the enclosing scope.

Answer: AC

NEW QUESTION 118


Teams at Universal Containers(UC) work on multiple JavaScript projects at the same time. UC is thinking about reusability and how each team can benefit from
the work of others. Going open-source or public is not an option at this time.
Which option is available to UC with npm?

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

A. Private packages can be scored, and scopes can be associated to a private registries.
B. Private registries are not supported by npm, but packages can be installed via URL.
C. Private packages are not supported, but they can use another package manager like yarn.
D. Private registries are not supported by npm, but packages can be installed via git.

Answer: A

NEW QUESTION 123


GIven a value, which three options can a developer use to detect if the value is NaN? Choose 3 answers !

A. value == NaN
B. Object.is(value, NaN)
C. value === Number.NaN
D. value ! == value
E. Number.isNaN(value)

Answer: AE

NEW QUESTION 126


Which statement accurately describes an aspect of promises?

A. Arguments for the callback function passed to .then() are optional.


B. In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.
C. .then() cannot be added after a catch.
D. .then() manipulates and returns the original promise.

Answer: A

NEW QUESTION 130


A developer has code that calculates a restaurant bill, but generates incorrectanswers while testing the code:
function calculateBill ( items ) { let total = 0;
total += findSubTotal(items); total += addTax(total);
total += addTip(total); return total;
}
Which option allows the developer to step into each function execution within calculateBill?

A. Using the debugger command on line 05.


B. Using the debugger command on line 03
C. Calling the console.trace (total) method on line 03.
D. Wrapping findSubtotal in a console.log() method.

Answer: A

NEW QUESTION 132


Which two console logs outputs NaN? Choose 2 answers

A. console.log(10/ Number(‘5’));
B. console.log(parseInt(‘two’));
C. console.log(10/ ‘’five);
D. console.log(10/0);

Answer: BC

NEW QUESTION 136


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

NEW QUESTION 139


Which statement phrases successfully?

A. JSON.parse ( ‘ foo ’ );
B. JSON.parse ( “ foo ” );
C. JSON.parse( “ ‘ foo ’ ” );
D. JSON.parse(‘ “ foo ” ’);

Answer: D

NEW QUESTION 140

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

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

NEW QUESTION 143


Given code below: setTimeout (() => ( console.log(1);
). 0);
console.log(2);
New Promise ((resolve, reject )) = > ( setTimeout(() => ( reject(console.log(3));
). 1000);
)).catch(() => ( console.log(4);
));
console.log(5);
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

NEW QUESTION 144


Which three statements are true about promises ? Choose 3 answers

A. The executor of a new Promise runs automatically.


B. A Promise has a .then() method.
C. A fulfilled or rejected promise will not change states .
D. A settled promise can become resolved.
E. A pending promise canbecome fulfilled, settled, or rejected.

Answer: BCE

NEW QUESTION 148


Refer to the code snippet below: Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++) if (array[i] === 4) {
array.splice(i, 1);
}
}

What is the value of array after the code executes?

A. [1, 2, 3, 4, 5, 4, 4]
B. [1, 2, 3, 4, 4, 5, 4]
C. [1, 2, 3, 5]
D. [1, 2, 3, 4, 5, 4]

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

Answer: B

NEW QUESTION 151


A developer implements a function that adds a few values.

Which three options can the developer invoke for this function to get a return value of 10 ? Choose 3 answers

A. Sum () (20)
B. Sum (5, 5) ()
C. sum() (5, 5)
D. sum(5)(5)
E. sum(10) ()

Answer: CD

NEW QUESTION 156


Given the JavaScript below:
1 function filterDOM (searchString) {
2 const parsedSearchString = searchString && searchString.toLowerCase() ;
03 document.quesrySelectorAll(‘ .account’ ) . forEach(account => (
04 const accountName = account.innerHTML.toLOwerCase();
05 account. Style.display = accountName.includes(parsedSearchString) ? /*Insert code*/;
06 )};
07 }
Which code should replace the placeholder comment on line 05 to hide accounts that do not match thesearch string?

A. ‘ name ’ : ‘ block ’
B. ‘ Block ’ : ‘ none ’
C. ‘ visible ’ : ‘ hidden ’
D. ‘ hidden ’ : ‘ visible ’

Answer: B

NEW QUESTION 161


......

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Welcome to download the Newest 2passeasy JavaScript-Developer-I dumps
https://www.2passeasy.com/dumps/JavaScript-Developer-I/ (157 New Questions)

THANKS FOR TRYING THE DEMO OF OUR PRODUCT

Visit Our Site to Purchase the Full Set of Actual JavaScript-Developer-I Exam Questions With Answers.

We Also Provide Practice Exam Software That Simulates Real Exam Environment And Has Many Self-Assessment Features. Order the
JavaScript-Developer-I Product From:

https://www.2passeasy.com/dumps/JavaScript-Developer-I/

Money Back Guarantee

JavaScript-Developer-I Practice Exam Features:

* JavaScript-Developer-I Questions and Answers Updated Frequently

* JavaScript-Developer-I Practice Questions Verified by Expert Senior Certified Staff

* JavaScript-Developer-I Most Realistic Questions that Guarantee you a Pass on Your FirstTry

* JavaScript-Developer-I Practice Test Questions in Multiple Choice Formats and Updatesfor 1 Year

Passing Certification Exams Made Easy visit - https://www.2PassEasy.com


Powered by TCPDF (www.tcpdf.org)

You might also like