Summer Special - 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: c4sdisc65

JavaScript-Developer-I PDF

$38.5

$109.99

3 Months Free Update

  • Printable Format
  • Value of Money
  • 100% Pass Assurance
  • Verified Answers
  • Researched by Industry Experts
  • Based on Real Exams Scenarios
  • 100% Real Questions

JavaScript-Developer-I PDF + Testing Engine

$61.6

$175.99

3 Months Free Update

  • Exam Name: Salesforce Certified JavaScript Developer (JS-Dev-101)
  • Last Update: Sep 12, 2025
  • Questions and Answers: 219
  • Free Real Questions Demo
  • Recommended by Industry Experts
  • Best Economical Package
  • Immediate Access

JavaScript-Developer-I Engine

$46.2

$131.99

3 Months Free Update

  • Best Testing Engine
  • One Click installation
  • Recommended by Teachers
  • Easy to use
  • 3 Modes of Learning
  • State of Art Technology
  • 100% Real Questions included

JavaScript-Developer-I Practice Exam Questions with Answers Salesforce Certified JavaScript Developer (JS-Dev-101) Certification

Question # 6

Which function should a developer use to repeatedly execute code at a fixed interval ?

A.

setIntervel

B.

setTimeout

C.

setPeriod

D.

setInteria

Full Access
Question # 7

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

Full Access
Question # 8

Refer to the code below:

JavaScript-Developer-I question answer

Which value can a developer expect when referencing country,capital,cityString?

A.

'London'

B.

undefined

C.

An error

D.

'NaN'

Full Access
Question # 9

A developer has an ErrorHandler module that contains multiple functions.

What kind of export should be leveraged so that multiple functions can be used?

A.

all

B.

named

C.

multi

D.

default

Full Access
Question # 10

Refer to code below:

Let first = ‘who’;

Let second = ‘what’;

Try{

Try{

Throw new error(‘Sad trombone’);

}catch (err){

First =’Why’;

}finally {

Second =’when’;

} catch (err) {

Second =’Where’;

}

What are the values for first and second once the code executes ?

A.

First is Who and second is When

B.

First is why and second is where

C.

First is who and second is where

D.

First is why and second is when

Full Access
Question # 11

A developer is setting up a new Node.js server with a client library that is built using events and callbacks.

The library:

? Will establish a web socket connection and handle receipt of messages to theserver

? Will be imported with require, and made available with a variable called we.

The developer also wants to add error logging if a connection fails.

Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?

A.

ws.connect (( ) => {console.log(‘connected to client’); }).catch((error) => { console.log(‘ERROR’ , error); }};

B.

ws.on (‘connect’, ( ) => {console.log(‘connected to client’); ws.on(‘error’, (error) => { console.log(‘ERROR’ ,error); });}); C. ws.on (‘connect’, ( ) => { console.log(‘connected to client’); }}; ws.on(‘error’, (error) => { console.log(‘ERROR’ , error); }};

C.

try{ws.connect (( ) => {console.log(‘connected to client’); });} catch(error) { console.log(‘ERROR’ ,error); };}

Full Access
Question # 12

Refer to HTML below:

This card is smaller.

The width and height of this card is determined by its

contents.

Which expression outputs the screen width of the element with the ID card-01?

A.

document.getElementById(‘ card-01 ’).getBoundingClientRest().width

B.

document.getElementById(‘ card-01 ’).style.width

C.

document.getElementById(‘ card-01 ’).width

D.

document.getElementById(‘ card-01 ’).innerHTML.lenght*e

Full Access
Question # 13

Given the code below:

Setcurrent URL ();

console.log(‘The current URL is: ‘ +url );

functionsetCurrentUrl() {

Url = window.location.href:

What happens when the code executes?

A.

The url variable has local scope and line 02 throws an error.

B.

The url variable has global scope and line 02 executes correctly.

C.

The url variable has global scope and line 02 throws an error.

D.

The url variable has local scope and line 02 executes correctly.

Full Access
Question # 14

Refer to the code below:

Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];

Which two statements result in the array [1, 2, 3, 4, 5] ?

Choose 2 answers

A.

[ ]. Concat.apply ([ ], inArray);

B.

[]. Concat (... inArray);

C.

[ ]. concat.apply(inArray, [ ]);

D.

[ ]. concat ( [ ….inArray ] );

Full Access
Question # 15

Refer to the code below:

Async funct on functionUnderTest(isOK) {

If (isOK) return ‘OK’;

Throw new Error(‘not OK’);

)

Which assertion accurately tests the above code?

A.

Console.assert (await functionUnderTest(true), ‘ OK ’)

B.

Console.assert (await functionUnderTest(true), ‘ not OK ’)

C.

Console.assert (await functionUnderTest(true), ‘ notOK ’)

D.

Console.assert (await functionUnderTest(true), ‘OK’)

Full Access
Question # 16

A developer has the function, shown below, that is called when a page loads.

JavaScript-Developer-I question answer

Where can the developer see the log statement after loading the page in the browser?

A.

On the browser JavaScriptconsole

B.

On the terminal console running the web server

C.

In the browser performance tools log

D.

On the webpage console log

Full Access
Question # 17

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

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 teamhas 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.

Installs with its own package manager to install and manage third-party libraries.

B.

Ensures stabilitywith 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.

Uses non-blocking functionality for performant requesthandling .

Full Access
Question # 18

A developer has the following array of hourly wages:

Let arr = (8, 5, 9, 75, 11, 25, 7, 75, , 13, 25);

For workers making less than $10 an hour rate should be multiple by 1.25 and returned in a new array.

How should the developer implement the request?

A.

let arrl = arr.filter((val) => val < 10).map((num) -> num = 1.25);

B.

let arrl = arr .rr.acArray ((val) => ( val < 10 )) ,map((num) => { num * 1.25 ));

C.

let arrl = arr-map((num) => { return ran * 1.25 }).filter((val) -> { return val < 10));

D.

let arrl = arr.filterBy((val) => val < 10 ).aapBy<(num) -> num = ..25 );

Full Access
Question # 19

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';universalContainersLib. foo ()7universalContainersLib.bar ();

B.

import {foo,bar} from '/path/universalCcontainersLib.js';foo():bar()?

C.

import all from '/path/universalContainersLib.js';universalContainersLib.foo();universalContainersLib.bar ();

D.

import * as lib from '/path/universalContainersLib.js';lib.foo();lib. bar ();

Full Access
Question # 20

Which two options are core Node.js modules?

Choose 2 answers

A.

worker

B.

isotream

C.

exception

D.

http

Full Access
Question # 21

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 type Boolean ?

Choose 2 answers:

A.

Boolean(var1 && var2)

B.

var1 && var2

C.

var1.toBoolean() && var2toBoolean()

D.

Boolean(var1) && Boolean(var2)

Full Access
Question # 22

Given the following code:

Counter = 0;

const logCounter = () => {

console.log(counter);

);

logCounter();

setTimeout(logCOunter, 1100);

setInterval(() => {

Counter++

logCounter();

}, 1000);

What is logged by the first four log statements?

A.

0 0 1 2

B.

0 1 2 3

C.

0 1 1 2

D.

0 1 2 2

Full Access
Question # 23

Cloud Kicks has a class to represent items for sale in an online store, as shown below:

Class Item{

constructor (name, price){

this.name = name;

this.price = price;

}

formattedPrice(){

return ‘s’ + String(this.price);}}

A new business requirement comes in that requests a ClothingItem class that should have all of

the properties and methods of the Item class but will also have properties that are specific to

clothes.

Which line of code properly declares the clothingItem class such that it inherits from

Item?

A.

Class ClothingItem implements Item{

B.

Class ClothingItem {

C.

Class ClothingItem super Item {

D.

Class ClothingItem extends Item {

Full Access
Question # 24

A developer uses a parsed JSON string to work with user information as in the block below:

01 const userInformation ={

02 “ id ” : “user-01”,

03 “email” : “user01@universalcontainers.demo”,

04 “age” : 25

Which two options access the email attribute in the object?

Choose 2 answers

A.

userInformation(“email”)

B.

userInformation.get(“email”)

C.

userInformation.email

D.

userInformation(email)

Full Access
Question # 25

In the browser, the window object is often used to assign variables that require the broadest scope in an application Node.js application does not have access to the window object by default.

Which two methods areused to address this ?

Choose 2 answers

A.

Use the document object instead of the window object.

B.

Assign variables to the global object.

C.

Create a new window object in the root file.

D.

Assign variables to module.exports and require them as needed.

Full Access
Question # 26

Refer to code below:

Function muFunction(reassign){

Let x = 1;

var y = 1;

if( reassign ) {

Let x= 2;

Var y = 2;

console.log(x);

console.log(y);}

console.log(x);

console.log(y);}

What is displayed when myFunction(true) is called?

A.

2 2 1 1

B.

2 2 undefined undefined

C.

2 2 1 2

D.

2 2 2 2

Full Access
Question # 27

A developer creates a simple webpage with an input field. When a user enters text in

the inputfield and clicks the button, the actual value of the field must be displayed in the

console.

Here is the HTML file content:

<button type =”button” >Display

The developer wrote the javascript codebelow:

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() {

Full Access
Question # 28

Refer to the code below

let inArray = [[1,2],[3,4,5]];

which two statements results in the array [1,2,3,4,5]?

choose 2 answer

A.

[ ].concat(...inArray);

B.

[ ].concat.apply(inArray,[ ]);

C.

[ ].concat([...inArray])

D.

[ ].concat.apply([ ],inArray);

Full Access
Question # 29

Given the following code:

Let x =(‘15’ + 10)*2;

What is the value of a?

A.

3020

B.

1520

C.

50

D.

35

Full Access
Question # 30

A developer is asked to fix some bugs reported by users. To do that, the developer adds

abreakpoint for debugging.

Function Car (maxSpeed, color){

This.maxspeed =masSpeed;

This.color = color;

Let carSpeed = document.getElementById(‘ CarSpeed’);

Debugger;

Let fourWheels =new Car (carSpeed.value, ‘red’);

When the code execution stops at the breakpoint on line 06, which two types of information are

available in the browser console ?

Choose 2 answers:

A.

The values of the carSpeed and fourWheels variables

B.

A variable displaying the number of instances created for the Car Object.

C.

The style, event listeners and other attributes applied to the carSpeed DOM element

D.

The information stored in the window.localStorage property

Full Access
Question # 31

Refer to the following array:

Let arr1 = [ 1,2, 3, 4, 5 ];

JavaScript-Developer-I question answer

Which two lines of code result in a second array, arr2 being created such that arr2 is not

a reference to arr1?

A.

Let arr2 = arr1.slice(0, 5);

B.

Let arr2 = Array.from(arr1);

C.

Let arr2 = arr1;

D.

Let arr2 = arr1.sort();

Full Access
Question # 32

Given the requirement to refactor the code above to JavaScript class format, which class

definition is correct?

JavaScript-Developer-I question answer

A)

JavaScript-Developer-I question answer

B)

JavaScript-Developer-I question answer

C)

JavaScript-Developer-I question answer

D)

JavaScript-Developer-I question answer

Full Access
Question # 33

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)

JavaScript-Developer-I question answer

B)

JavaScript-Developer-I question answer

C)

JavaScript-Developer-I question answer

D)

JavaScript-Developer-I question answer

A.

Option

B.

Option

C.

Option

D.

Option

Full Access
Question # 34

Refer to the expression below:

Let x = (‘1’ + 2) == (6 * 2);

How should this expression be modified to ensure that evaluates to false?

A.

Let x = (‘1’ + ‘ 2’) == ( 6 * 2);

B.

Let x = (‘1’ + 2) == ( 6 * 2);

C.

Let x = (1 + 2) == ( ‘6’ / 2);

D.

Let x = (1+ 2 ) == ( 6 / 2);

Full Access
Question # 35

Refer to the code below:

let timeFunction =() => {

console.log(‘Timer called.”);

};

let timerId = setTimeout (timedFunction, 1000);

Which statement allows a developer to cancel the scheduled timed function?

A.

removeTimeout(timedFunction);

B.

removeTimeout(timerId);

C.

clearTimeout(timerId);

D.

clearTimeout(timedFunction);

Full Access
Question # 36

Refer to the code below:

letsayHello = () => {

console.log (‘Hello, world!’);

};

Which code executes sayHello once, two minutes from now?

A.

setTimeout(sayHello, 12000);

B.

setInterval(sayHello, 12000);

C.

setTimeout(sayHello(), 12000);

D.

delay(sayHello, 12000);

Full Access
Question # 37

A developer wants to define a function log to be used a few times on a single-file JavaScript script.

01 // Line 1 replacement

02 console.log('"LOG:', logInput);

03 }

Which two options can correctly replaceline 01 and declare the function for use?

Choose 2 answers

A.

function leg(logInput) {

B.

const log(loginInput) {

C.

const log = (logInput) => {

D.

function log = (logInput) {

Full Access
Question # 38

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 1 3 4

C.

1 2 43 5

D.

1 2 5 3 4

Full Access
Question # 39

Which code statement below correctly persists an objects inlocal Storage ?

A.

const setLocalStorage = (storageKey, jsObject) => {window.localStorage.setItem(storageKey, JSON.stringify(jsObject));}

B.

const setLocalStorage = ( jsObject) => {window.localStorage.connectObject(jsObject));}

C.

const setLocalStorage= ( jsObject) => {window.localStorage.setItem(jsObject);}

D.

const setLocalStorage = (storageKey, jsObject) => {window.localStorage.persist(storageKey, jsObject);}

Full Access
Question # 40

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

A.

The function has an error that should not 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.

Full Access
Question # 41

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 is the resultof executing line 04?

A.

0

B.

6

C.

-Infinity

D.

RuntimeError

Full Access
Question # 42

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.

Letx= arr.filter((a) => ( return a>2 ));

E.

Let x = arr.slice(2,3);

Full Access
Question # 43

Given the code below:

JavaScript-Developer-I question answer

Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?

A.

console.group(usersList) ;

B.

console.table(usersList) ;

C.

console.info(usersList) ;

D.

console.groupCol lapsed (usersList) ;

Full Access
Question # 44

Refer to the following code block:

class Animal{

constructor(name){

this.name = name;

}

makeSound(){

console.log(`${this.name} ismaking 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

Full Access
Question # 45

Refer to the code below:

Function changeValue(obj) {

Obj.value = obj.value/2;

}

Const objA = (value: 10);

Const objB = objA;

changeValue(objB);

Const result = objA.value;

What is the value of result after the code executes?

A.

10

B.

Nan

C.

5

D.

Undefined

Full Access
Question # 46

Which statement parses successfully?

A.

JSON. parse (""foo"');

B.

JSON.parse (""foo'");

C.

JSON.parse ("foo");

D.

JSON.parse ("foo");

Full Access
Question # 47

A test has a dependency on database.query. During the test the dependency is replaced

with an object called database with the method, query, that returns an array. The

developer needs to verify how many times the method was called and the arguments

used each time.

Which two test approaches describe the requirement?

Choose 2 answers

A.

Integration

B.

Black box

C.

White box

D.

Mocking

Full Access
Question # 48

A developer at Universal Containers is creating their new landing pagebased on HTML, CSS, and JavaScript. The website includes multiple external resources that are loaded when the page is opened.

To ensure that visitors have a good experience, a script named personalizeWebsiteContent needs to be executed when the webpage isloaded and there is no need to wait for the resources to be available.

Which statement should be used to call personalizeWebsiteContent based on the above business requirement?

A.

windows,addEventListener('load', personalizeWebsiteContent);

B.

windows,addEventListener('DOMContent Loaded ', personalizeWebsiteContent);

C.

windows,addEventListener('onload', personalizeWebsiteContent);

D.

windows,addEventListener('onDOMCContentLoaded', personalizeWebsiteContent);

Full Access
Question # 49

A developer is leading the creation of a new browser application that will serve a single

page application. The team wants to use a new web framework Minimalsit.js.The Lead

developer wants to advocate for a more seasoned web framework that already has a

community around it.

Which two frameworks should the lead developer advocate for?

Choose 2 answers

A.

Vue

B.

Angular

C.

Koa

D.

Express

Full Access
Question # 50

Given the code below:

const copy = JSON.stringify([ newString(‘ false ’), new Bollean( false ), undefined ]);

What is the value of copy?

A.

-- [ \”false\” , { } ]--

B.

-- [ false, { } ]--

C.

-- [ \”false\” , false, undefined ]--

D.

-- [ \”false\” ,false, null ]--

Full Access
Question # 51

A developer wants to create an object from a function in the browser using the code

below:

Function Monster() { this.name = ‘hello’ };

Const z = Monster();

What happens due to lackof the new keyword on line 02?

A.

The z variable is assigned the correct object.

B.

The z variable is assigned the correct object but this.name remains undefined.

C.

Window.name is assigned to ‘hello’ and the variable z remains undefined.

D.

Window.m is assigned the correct object.

Full Access
Question # 52

A developer is required to write a function that calculates the sum of elements in an

array but is getting undefined every 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 line02 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;

Full Access
Question # 53

A developer has two ways to write a function:

Option A:

function Monster() {

This.growl = () => {

Console.log (“Grr!”);

}

}

Option B:

function Monster() {};

Monster.prototype.growl =() => {

console.log(“Grr!”);

}

After deciding on an option, the developer creates 1000 monster objects.

How many growl methods are created with Option A Option B?

A.

1 growl method is created for Option A.1000 growl methods are created for Option B.

B.

1000 growl method is created for Option A. 1 growl methods are created for Option B.

C.

1000 growl methods are created regardless of which option is used.

D.

1 growl method is created regardless of whichoption is used.

Full Access
Question # 54

Refer to the code below:

const car = {

price:100,

getPrice:function(){

return this.price;

}

};

const customCar = Object.create(car);

customCar.price = 70;

delete customCar.price;const result = customCar.getPrice();

Whatis the value of result after the code executes?

A.

100

B.

undefined

C.

null

D.

70

Full Access
Question # 55

Refer to the code declarations below:

JavaScript-Developer-I question answer

Which three expressions return the string JavaScript?

Choose 3 answers

A.

Str1.join (str2);

B.

Str1.concat (str2);

C.

Concat (str1, str2);

D.

$(str1) $ (str2} ‘;

E.

Str1 + str2;

Full Access
Question # 56

A developer is setting up a Node,js server and is creating a script at the root of the source code, index,js, that will start the server when executed. The developer declares a variable that needsthe folder location that the code executes from.

Which global variable can be used in the script?

A.

window.location

B.

_filename

C.

_dirname

D.

this.path

Full Access
Question # 57

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

Full Access
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/PricePrettyPrint.js’;

Based on the code, what mustbe 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

Full Access
Question # 59

Given the code below:

const delay = async delay =>{

return new Promise((resolve,reject)=>{

console.log(1);

setTimeout(resolve,deleay);

});

};

const callDelay =async ()=>{

console.log(2);

const yup = await delay(1000);

console.log(3);

}

console.log(4);

callDelay();

console.log(5);

What is logged to the console?

A.

4 2 1 5 3

Full Access
Question # 60

A developer has an ErrorHandler module that contains multiple functions.

What kind of export be leverages so that multiple functions can beused?

A.

Named

B.

All

C.

Multi

D.

Default

Full Access
Question # 61

Refer to the code below:

01 const exec = (item, delay) =>{

02 newPromise(resolve => setTimeout( () => resolve(item), delay)),

03 async function runParallel() {

04 Const (result1, result2, result3) = await Promise.all{

05 [exec (‘x’, ‘100’) , exec(‘y’, 500), exec(‘z’, ‘100’)]

06 );

07 return `parallel is done: $(result1)$(result2)$(result3)`;

08 }

}

}

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

Full Access
Question # 62

A developer wants to create an object from a function in the browser using the code below.

JavaScript-Developer-I question answer

What happens due to the lack of the mm keyword on line 02?

A.

window.name is assigned to 'hello' and the variable = remains undefined.

B.

window.m Is assigned the correct object.

C.

The m variable is assigned the correct object but this.name remains undefined.

D.

The m variable is assigned the correct object.

Full Access
Question # 63

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?

A.

Private packages can be scored, andscopes can be associated to a privateregistries.

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 likeyarn.

D.

Private registries are not supported by npm, but packages can be installed via git.

Full Access
Question # 64

A developer has code that calculates a restaurant bill, but generates incorrect answers

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.

Full Access
Question # 65

is below:

”Image

The JavaScript portion is:

01 functionpreviewFile(){

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 File();08 if (file) URL.createObjectURL(file);

B.

04 const reader = new FileReader();08if (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);

Full Access