Black Friday Special - 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dm70dm

Hot Vendors

JavaScript-Developer-I Salesforce Certified JavaScript Developer I (SU24) Questions and Answers

Questions 4

A developer has the following array of student test grades:

Let arr = [ 7, 8, 5, 8, 9 ];

The Teacher wants to double each score and then see an array of the students

who scored more than 15 points.

How should the developer implement the request?

Options:

A.

Let arr1 = arr.filter(( val) => ( return val > 15 )) .map (( num) => ( return num *2 ))

B.

Let arr1 = arr.mapBy (( num) => ( return num *2 )) .filterBy (( val ) => return val > 15 )) ;

C.

Let arr1 = arr.map((num) => num*2). Filter (( val) => val > 15);

D.

Let arr1 = arr.map((num) => ( num *2)).filterBy((val) => ( val >15 ));

Buy Now
Questions 5

Refer to code below:

Let a =’a’;

Let b;

// b = a;

console.log(b);

What is displayed when the code executes?

Options:

A.

ReferenceError: b is not defined

B.

A

C.

Undefined

D.

Null

Buy Now
Questions 6

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

a breakpoint 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:

Options:

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

Buy Now
Questions 7

Given the following code:

let x = null;

console.log(typeof x);

What is the output?

Options:

A.

"object"

B.

"undefined"

C.

"null"

D.

"x"

Buy Now
Questions 8

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 9

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 that x evaluates to 6 in the line below?

Let x = calculate (8);

Options:

A.

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

B.

Return (Number (num +10 ) / 3;

C.

Return Integer(num +10) /3;

D.

Return Number(num + 10) / 3;

Buy Now
Questions 10

Which two code snippets show working examples of a recursive function?

Choose 2 answers

Options:

A.

Let countingDown = function(startNumber) {

If ( startNumber >0) {

console.log(startNumber) ;

return countingDown(startNUmber);

} else {

return startNumber;

}};

B.

Function factorial ( numVar ) {

If (numVar < 0) return;

If ( numVar === 0 ) return 1;

return numVar -1;

C.

Const sumToTen = numVar => {

If (numVar < 0)

Return;

return sumToTen(numVar + 1)};

D.

Const factorial =numVar => {

If (numVar < 0) return;

If ( numVar === 0 ) return 1;

return numVar * factorial ( numVar - 1 );

};

Buy Now
Questions 11

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

JavaScript-Developer-I Question 11

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 12

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 13

Refer to the following code:

class Vehicle{

constructor(plate){

this.plate = plate;

}

}

class Truck extends Vehicle{

constructor(plate, weight){

//Missing code

this.weight = weight;

}

displayWeight(){

console.log(`The truck ${this.plate} has a weight of ${this.weight}lb.`);

}

}let myTruck = new Truck('123Ab',5000);

myTruck.displayWeight();

Which statement should be added to missing code for the code to display 'The truck 123AB has a

weight of 5000lb.

Options:

A.

super(plate)

B.

super.plate = plate

C.

Vehicle.plate = plate

D.

this.plate = plate

Buy Now
Questions 14

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

JavaScript-Developer-I Question 14

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 15

Refer to the code below:

Let textValue = ’1984’;

Which code assignment shows a correct way to convert this string to an integer?

Options:

A.

let numberValue = Number(textValue);

B.

Let numberValue = (Number)textValue;

C.

Let numberValue = textValue.toInteger();

D.

Let numberValue = Integer(textValue);

Buy Now
Questions 16

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 needs the folder location that the code executes from.

Which global variable can be used in the script?

Options:

A.

window.location

B.

_filename

C.

_dirname

D.

this.path

Buy Now
Questions 17

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 18

A developer is leading the creation of a new web server for their team that will fulfill API requests from an existing client.

The team wants a web server that runs on Node.Js, and they want to use the new web framework Minimalist.Js. The lead developer wants to advocate for a more seasoned back-end framework that already has a community around it.

Which two frameworks could the lead developer advocate for?

Choose 2 answers

Options:

A.

Gatsby

B.

Angular

C.

Express

D.

Koa

Buy Now
Questions 19

Refer to the code below:

Const myFunction = arr => {

Return arr.reduce((result, current) =>{

Return result = current;

}, 10};

}

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

Options:

A.

Returns 0

B.

Throws an error

C.

Returns 10

D.

Returns NaN

Buy Now
Questions 20

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 result of executing line 04?

Options:

A.

0

B.

6

C.

-Infinity

D.

RuntimeError

Buy Now
Questions 21

Considering type coercion, what does the following expression evaluate to?

True + ‘13’ + NaN

Options:

A.

‘ 113Nan ’

B.

14

C.

‘ true13 ’

D.

‘ true13NaN ’

Buy Now
Questions 22

Given the JavaScript below:

JavaScript-Developer-I Question 22

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 23

Which statement can a developer apply to increment the browser's navigation history without a page refresh?

Which statement can a developer apply to increment the browser's navigation history without a page refresh?

Options:

A.

window.history.pushState(newStateObject);

B.

window.history.pushStare(newStateObject, ' ', null);

C.

window.history.replaceState(newStateObject,' ', null);

D.

window.history.state.push(newStateObject);

Buy Now
Questions 24

Given the following code:

JavaScript-Developer-I Question 24

is the output of line 02?

Options:

A.

''x''

B.

''null'''

C.

''object''

D.

''undefined''

Buy Now
Questions 25

Which option is a core Node,js module?

Options:

A.

Path

B.

Ios

C.

Memory

D.

locate

Buy Now
Questions 26

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:

Options:

A.

Boolean(var1 && var2)

B.

var1 && var2

C.

var1.toBoolean() && var2toBoolean()

D.

Boolean(var1) && Boolean(var2)

Buy Now
Questions 27

A developer wants to set up a secure web server with Node.js. The developer creates a

directory locally called app-server, and the first file is app-server/index.js

Without using any third-party libraries, what should the developer add to index.js to create the

secure web server?

Options:

A.

const https =require(‘https’);

B.

const server =require(‘secure-server’);

C.

const tls = require(‘tls’);

D.

const http =require(‘http’);

Buy Now
Questions 28

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

D.

1 2 5 3 4

Buy Now
Questions 29

A developer writes the code below to calculate the factorial of a given number

function sum(number){

return number * sum(number-1);

}

sum(3);

what is the result of executing the code.

Options:

A.

0

B.

6

C.

Error

D.

-Infinity

Buy Now
Questions 30

Refer to the code below:

JavaScript-Developer-I Question 30

Considering that JavaScript is single-threaded, what is the output of line 08 after the code executes?

Options:

A.

10

B.

11

C.

12

D.

13

Buy Now
Questions 31

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 32

Given the following code, what is the value of x?

let x = ‘15' + (10 * 2);

Options:

A.

35

B.

50

C.

1520

D.

3020

Buy Now
Questions 33

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
Exam Name: Salesforce Certified JavaScript Developer I (SU24)
Last Update: Nov 18, 2024
Questions: 215

PDF + Testing Engine

$48  $159.99

Testing Engine

$36  $119.99
buy now JavaScript-Developer-I testing engine

PDF (Q&A)

$30  $99.99
buy now JavaScript-Developer-I pdf
dumpsmate guaranteed to pass
24/7 Customer Support

DumpsMate's team of experts is always available to respond your queries on exam preparation. Get professional answers on any topic of the certification syllabus. Our experts will thoroughly satisfy you.

Site Secure

mcafee secure

TESTED 22 Nov 2024