Winter Special Sale - Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 575363r9

Welcome To DumpsPedia

JavaScript-Developer-I Sample Questions Answers

Questions 4

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 running line 05?

Options:

A.

aPromise and bPromise run sequentially.

B.

Neither aPromise or bPromise runs.

C.

aPromise and bPromise run in parallel.

D.

Only aPromise runs.

Buy Now
Questions 5

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:

Options:

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

Buy Now
Questions 6

A developer wants to use a module called DataPrettyPrint. This module exports one default functioncalled printDate ().

How can a developer import and use the printDate() function?

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 7

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

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

Options:

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.

Buy Now
Questions 8

Refer to the code below:

let o = {

get js() {

let city1 = String("st. Louis");

let city2 = String(" New York");

return {

firstCity: city1.toLowerCase(),

secondCity: city2.toLowerCase(),

}

}

}

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

Options:

A.

Undefined

B.

‘ new york ’

C.

‘ New York ’

D.

An error

Buy Now
Questions 9

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

Options:

A.

Vue

B.

Angular

C.

Koa

D.

Express

Buy Now
Questions 10

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?

Options:

A.

Event.clicked

B.

e.nodeTarget ==this

C.

event.target.nodeName == ‘BUTTON’

D.

button.addEventListener(‘click’)

Buy Now
Questions 11

A developer has an is Dog function that takes one argument cat. They want to schedule the function to run every minute.

What is the correct syntax for scheduling this function?

Options:

A.

setInterval(isDog, 60000,'cat');

Buy Now
Questions 12

Which three browser specific APIs are available for developers to persist data between page loads ?

Choose 3 answers

Options:

A.

IIFEs

B.

indexedDB

C.

Global variables

D.

Cookies

E.

localStorage.

Buy Now
Questions 13

Refer to the code below:

01 let car1 = new promise((_, reject) =>

02 setTimeout(reject, 2000, “Car 1 crashed in”));

03 let car2 = new Promise(resolve => setTimeout(resolve, 1500, “Car 2

completed”));

04 let car3 = new Promise(resolve => setTimeout (resolve, 3000, “Car 3

Completed”));

05 Promise.race([car1, car2, car3])

06 .then(value => (

07 let result = $(value) the race. `;

08 ))

09 .catch( arr => (

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

11 ));

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

Options:

A.

Car 3 completed the race.

B.

Car 1 crashed in the race.

C.

Car 2 completed the race.

D.

Race is cancelled.

Buy Now
Questions 14

A developer has an ErrorHandler module that contains multiple functions.

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

Options:

A.

all

B.

named

C.

multi

D.

default

Buy Now
Questions 15

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?

Options:

A.

0 0 1 2

B.

0 1 2 3

C.

0 1 1 2

D.

0 1 2 2

Buy Now
Questions 16

Refer to the codebelow:

function foo () {

const a =2;

function bat() {

console.log(a);

}

return bar;

}

Why does the function bar have access to variable a ?

Options:

A.

Inner function’s scope

B.

Hoisting

C.

Outer function’s scope

D.

Prototype chain

Buy Now
Questions 17

Whichthree actions can be using the JavaScript browser console?

Choose 3 answers:

Options:

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 ofthe page.

E.

View and change security cookies.

Buy Now
Questions 18

Which statement phrases successfully?

Options:

A.

JSON.parse ( ‘ foo ’ );

B.

JSON.parse ( “ foo ” );

C.

JSON.parse( “ ‘ foo ’ ” );

D.

JSON.parse(‘ “ foo ” ’);

Buy Now
Questions 19

Given the JavaScript below:

Which code should replace the placeholder comment on line 06 to hide accounts that do not match the search string?

Options:

A.

‘None’ : ‘block’

B.

‘Visible : ’hidden’

C.

‘Hidden, visible

D.

‘Block’ : ‘none’

Buy Now
Questions 20

Which three statements are true about promises ?

Choose 3 answers

Options:

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.

Buy Now
Questions 21

Refer to the HTML below:

Which JavaScript statement results in changing “ The Lion.”?

Options:

A.

document.querySelectorAll(‘$main $TONY’).innerHTML = ’“ The Lion

B.

document.querySelector(‘$main li:second-child’).innerHTML = “The Lion ’;

C.

document.querySelector(‘$main li.Tony’).innerHTML = ’“ The Lion ’;

D.

document.querySelector(‘$main li:nth-child(2)’),innerHTML = “ The Lion. ’;

Buy Now
Questions 22

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 ?

Options:

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

Buy Now
Questions 23

Refer to the code below:

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

Options:

A.

Return 0

B.

Return 5

C.

Return NaN

D.

Return Infinity

Buy Now
Questions 24

GIven a value, which three options can a developer use to detect if thevalue is NaN?

Choose 3 answers !

Options:

A.

value == NaN

B.

Object.is(value, NaN)

C.

value === Number.NaN

D.

value ! == value

E.

Number.isNaN(value)

Buy Now
Questions 25

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?

Options:

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

Buy Now
Questions 26

Refer the code below.

x=3.14;

function myfunction() {

"use strict";

y=x;

}

z=x;

myFunction();

Options:

Buy Now
Questions 27

Refer to the following code:

Let obj ={

Foo: 1,

Bar: 2

}

Let output =[],

for(let something in obj{

output.push(something);

}

console.log(output);

What is the output line 11?

Options:

A.

[1,2]

B.

[“bar”,”foo”]

C.

[“foo”,”bar”]

D.

[“foo:1”,”bar:2”]

Buy Now
Questions 28

Refer to the code snippet:

Function getAvailabilityMessage(item) {

If (getAvailability(item)){

Var msg =”Username available”;

}

Return msg;

}

A developer writes this code to return a message to user attempting to register a new

username. If the username is available, variable.

What is the return value of msg hen getAvailabilityMessage (“newUserName” ) is

executed and getAvailability(“newUserName”) returns false?

Options:

A.

“Username available”

B.

“newUserName”

C.

“Msg is not defined”

D.

undefined

Buy Now
Questions 29

Refer to code below:

function Person() {

this.firstName = ’John’;

}

Person.prototype ={

Job: x => ‘Developer’

};

const myFather = new Person();

const result=myFather.firstName + ‘ ‘ + myFather.job();

What is the value of the result after line 10 executes?

Options:

A.

Error: myFather.job is not a function

B.

Undefined Developer

C.

John undefined

D.

John Developer

Buy Now
Questions 30

Given the HTML below:

Which statement adds the priority-account CSS class to the Universal Containers row?

Options:

A.

document. querySelector (#row-uc').classes-push('priority-account');

B.

document. getElementByid('row-uc').addClass('priority-account*);

C.

document. querySelectorAll('#row-uc') -classList.add("priority-accour');

D.

document. queryselector('#row-uc').ClassList.add('priority-account');

Buy Now
Questions 31

Which two options are core Node.js modules?

Choose 2 answers

Options:

A.

worker

B.

isotream

C.

exception

D.

http

Buy Now
Questions 32

Refer to the code below:

Click me!

Which code change should be made for the console to log only Row log when ‘Click me! ’ is

clicked?

Options:

A.

Add.event.stopPropagation(); to window.onLoad event handler.

B.

Add event.stopPropagation(); to printMessage function.

C.

Add event.removeEventListener(); to window.onLoad event handler.

D.

Add event.removeEventListener(); toprintMessage function.

Buy Now
Questions 33

At Universal Containers, every team has its own way of copyingJavaScript objects. The code snippet shows an Implementation from one team:

What is the output of the code execution?

Options:

A.

Hello John Doe

B.

Hello Dan

C.

Hello Dan Doe

D.

SyntaxError: Unexpected token in JSON

Buy Now
Questions 34

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:

Options:

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 .

Buy Now
Questions 35

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?

Options:

A.

2 1 4 3 5

B.

2 5 1 3 4

C.

1 2 43 5

D.

1 2 5 3 4

Buy Now
Questions 36

A developer is trying to handle an error within a function.

Which code segment shows the correct approach to handle an error without propagating it elsewhere?

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 37

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?

Options:

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

Buy Now
Questions 38

A developer at Universal Containers creates a new landing page based on HTML, CSS, and

JavaScript TO ensure that visitors have a goodexperience, a script named personaliseContext

needs to be executed when the webpage is fully loaded (HTML content and all related files ), in

order to do some custom initialization.

Which statement should be used to call personalizeWebsiteContent based onthe above

business requirement?

Options:

A.

document.addEventListener(‘’onDOMContextLoaded’, personalizeWebsiteContext);

B.

window.addEventListener(‘load’,personalizeWebsiteContext);

C.

window.addEventListener(‘onload’, personalizeWebsiteContext);

D.

Document.addEventListener(‘‘’DOMContextLoaded’ , personalizeWebsiteContext);

Buy Now
Questions 39

Given the following code:

What will be the first four numbers logged?

Options:

A.

0012

B.

0112

C.

0122

D.

0123

Buy Now
Questions 40

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?

Options:

A.

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

B.

[ ‘pizza’,’Burger’, ‘French fires’]

C.

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

D.

[ ‘Garlicbread’]

Buy Now
Questions 41

Considering the implications of 'use strict' on line 04, which three statements describe the execution of the code?

Choose 3 answers

Options:

A.

z is equal to 3.14.

B.

'use strict' is hoisted, so it has an effect on all lines.

C.

'use strict' has an effect only on line 05.

D.

'use strict' has an effect between line 04 and the end of the file.

E.

Line 05 throws an error.

Buy Now
Questions 42

developer creates a new web server that uses Node.js. It imports a server 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 thedeveloper has, which code logs an error at boost

with an event?

Options:

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

Buy Now
Questions 43

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?

Options:

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.

Buy Now
Questions 44

Refer the following code

what is the value of array after code executes?

Options:

Buy Now
Questions 45

A developer wrote the following code to 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 the array.

Which two results occur when running this test on the updated sum3 function?

Choose 2 answers

Options:

A.

The line 05 assertion passes.

B.

The line 02 assertion passes.

C.

The line 02 assertion fails.

D.

The line 05 assertion fails.

Buy Now
Questions 46

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 displayedin the console.

Here is the HTML file content:

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?

Options:

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 with button.addEventListener(“onclick”, function() {

Buy Now
Questions 47

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:

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?

Options:

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

Buy Now
Questions 48

Refer to the following array:

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

Which three options result in x evaluating as [1,2]?

Choose 3 answer

Options:

A.

let x = arr. slice (2);

B.

let x = arr. slice (0, 2);

C.

let x arr.filter((a) => (return a <= 2 });

D.

let x = arr.filter ((a) => 2 }) ;

E.

let x =arr.splice(0, 2);

Buy Now
Questions 49

Refer to the code below:

What is the value of result when the code executes?

Options:

A.

10-10

B.

5-5

C.

10-5

D.

5-10

Buy Now
Questions 50

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?

Options:

A.

10 -10

B.

5 -5

C.

5 - 10

D.

10 - 5

Buy Now
Questions 51

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?

Options:

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;

Buy Now
Questions 52

Given the code below:

Which three code segments result in a correct conversion from number to string? Choose 3 answers

Options:

A.

let strValue = numValue. toString();

B.

let strValue = * * 4 numValue;

C.

let strValue = numValue.toText ();

D.

let scrValue = String(numValue);

E.

let strValue = (String)numValue;

Buy Now
Questions 53

A developer has a web server running with Node.js. The command to start the web server is node server.js. The web server started having

latency issues. Instead of a one second turnaround for web requests, the developer now sees a five second turnaround.

Which command can the web developer run to see what the module is doing during the latency period?

Options:

A.

NODE_DEBUG=true node server.js

B.

DEBUG=http, https node server.js

C.

NODE_DEBUG=http,https node server.js

D.

DEBUG=true node server.js

Buy Now
Questions 54

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 ?

Options:

A.

node -i index.js

B.

Node --inspect-brk index.js

C.

Node inspect index.js

D.

Node --inspect index.js

Buy Now
Questions 55

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?

Options:

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]

Buy Now
Questions 56

Refer to the following code:

Let sampleText = ‘The quick brown fox jumps’;

A developer needs to determine if a certainsubstring is part of a string.

Which three expressions return true for the given substring ?

Choose 3 answers

Options:

A.

sampleText.includes(‘fox’);

B.

sampleText.includes(‘ quick ’, 4);

C.

sampleText.includes(‘ Fox ’, 3)

D.

sampleText.includes(‘ fox ’);

E.

sampleText.includes(‘ quick ’) !== -1;

Buy Now
Questions 57

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?

Options:

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

Buy Now
Questions 58

Given the code below:

Setcurrent URL ();

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

functionsetCurrentUrl() {

Url = window.location.href:

What happens when the code executes?

Options:

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.

Buy Now
Questions 59

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?

Options:

A.

windows,addEventListener('load', personalizeWebsiteContent);

B.

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

C.

windows,addEventListener('onload', personalizeWebsiteContent);

D.

windows,addEventListener('onDOMCContentLoaded', personalizeWebsiteContent);

Buy Now
Questions 60

Given the following code:

is the output of line 02?

Options:

A.

''x''

B.

''null'''

C.

''object''

D.

''undefined''

Buy Now
Questions 61

A developer writes the code below to return a message to a user attempting to register a new username. If the username is available, a variable named nag is declared and assigned a value on line 03.

What is the value of msg when getAvailableabilityMessage (“newUserName”) is executed and get Availability (“newUserName”) returns true?

Options:

A.

"msg is not defined"

B.

"newUserName"

C.

"User-name available"

D.

undefined

Buy Now
Questions 62

Referto the code below:

new Promise((resolve, reject) => {

const fraction = Math.random();

if( fraction >0.5) reject("fraction > 0.5, " + fraction);

resolve(fraction);

})

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

Options:

A.

When rejected

B.

When resolved and settled

C.

When resolved

D.

When resolved or rejected

Buy Now
Questions 63

A developer implements a function that adds a few values.

Function sum(num) {

If (num == undefined) {

Num =0;

}

Return function( num2, num3){

If (num3 ===undefined) {

Num3 =0 ;

}

Return num + num2 + num3;

}

}

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

Choose 3 answers

Options:

A.

Sum () (20)

B.

Sum (5, 5) ()

C.

sum() (5, 5)

D.

sum(5)(5)

E.

sum(10) ()

Buy Now
Questions 64

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 developercreates 1000 monster objects.

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

Options:

A.

1000 for Option A, 1 for Option B

B.

1 methods for both

C.

1000 for both

D.

1 for Option A, 1000 for Option B

Buy Now
Questions 65

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 toschedule this function?

Options:

A.

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

B.

setTimeout (formatName('John', ‘'Doe'), 5000);

C.

setTimout(() => { formatName("John', 'Doe') }, 5000);

D.

setTimeout ('formatName', 5000, 'John", "Doe');

Buy Now
Exam Code: JavaScript-Developer-I
Exam Name: Salesforce Certified JavaScript Developer I (SU24)
Last Update: Nov 13, 2024
Questions: 215
$64  $159.99
$48  $119.99
$40  $99.99
buy now JavaScript-Developer-I