Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Pass the Salesforce Developer JavaScript-Developer-I Questions and answers with ValidTests

Exam JavaScript-Developer-I All Questions
Exam JavaScript-Developer-I Premium Access

View all detail and faqs for the JavaScript-Developer-I exam

Viewing page 4 out of 5 pages
Viewing questions 31-40 out of questions
Questions # 31:

Refer the code below.

x=3.14;

function myfunction() {

"use strict";

y=x;

}

z=x;

myFunction();

Options:

Expert Solution
Questions # 32:

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.

Executesserver-side JavaScript code to avoid learning a new language.

E.

Uses non-blocking functionality for performant requesthandling .

Expert Solution
Questions # 33:

Refer to the string below.

Const str=’Salesforce’;

Which twostatementsresults in the word 'Sales'?

Options:

Expert Solution
Questions # 34:

Given the code below:

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

What is the value of copy?

Options:

A.

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

B.

-- [ false, { } ]--

C.

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

D.

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

Expert Solution
Questions # 35:

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

Choose 2 answers

Options:

A.

The function generated its own this making it useful 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 scope. C. If the function has a single expression in the function body, the expression will be evaluated and implicit returned.

C.

The function uses the this from the enclosing scope.

Expert Solution
Questions # 36:

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

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

02 //missing line 03

04 ). 0);

Which missing lines 02 and 03 return the correctcount?

Options:

A.

Const sum = curr.startsWith(‘N’) ? 1: 0;Return acc +sum

B.

Const sum = curr.name.startsWith(‘N’) ? 1: 0;Return acc +sum

C.

Const sum = curr.startsWIth(‘N’) ? 1: 0;Return curr+ sum

D.

Const sum =curr.name.startsWIth(‘N’) ? 1: 0;Return curr+ sum

Expert Solution
Questions # 37:

Refer to code below:

console.log(0);

setTimeout(() => (

console.log(1);

});

console.log(2);

setTimeout(() => {

console.log(3);

), 0);

console.log(4);

In which sequence will the numbers be logged?

Options:

A.

01234

B.

02431

C.

02413

D.

13024

Expert Solution
Questions # 38:

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

Question # 38

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

Expert Solution
Questions # 39:

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

Options:

A.

setIntervel

B.

setTimeout

C.

setPeriod

D.

setInteria

Expert Solution
Questions # 40:

Why would a developerspecify apackage.jason as a developed forge instead of a dependency ?

Options:

A.

It is required by the application in production.

B.

It is only needed for local development and testing.

C.

Other required packages depend on it for development.

D.

It should be bundled when the package is published.

Expert Solution
Viewing page 4 out of 5 pages
Viewing questions 31-40 out of questions