Spring Sale Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Salesforce JavaScript-Developer-I - Salesforce Certified JavaScript Developer (JS-Dev-101)

Page: 4 / 7
Total 219 questions

A developer needs to debug a Node.js web server because a runtime error keeps occurring at one of the endpoints.

The developer wants to test the endpoint on a local machine and make the request against a local server to look at the behavior. In the source code, the server, js file will start the server. the developer wants to debug the Node.js server only using the terminal.

Which command can the developer use to open the CLI debugger in their current terminal window?

A.

node -i server.js

B.

node inspect server,js

C.

node server,js inspect

D.

node start inspect server,js

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

A developer is wondering whether to use, Promise.then or Promise.catch, especially

when a Promise throws an error?

Which two promises are rejected?

Which 2 are correct?

A.

Promise.reject(‘cool errorhere’).then(error => console.error(error));

B.

Promise.reject(‘cool error here’).catch(error => console.error(error));

C.

New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error =>console.error(error)) ;

D.

New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));

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?

A.

[1,2]

B.

[“bar”,”foo”]

C.

[“foo”,”bar”]

D.

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

Refer to the code declarations below:

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;

Given the 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. getElementByid('row-uc').addClass('priority-account*);

C.

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

D.

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

Which statement phrases successfully?

A.

JSON.parse ( ‘ foo ’ );

B.

JSON.parse ( “ foo ” );

C.

JSON.parse( “ ‘ foo ’ ” );

D.

JSON.parse(‘ “ foo ” ’);

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.

myArraym can have one level, two levels, or more levels.

Which statement flattens myArray when it can be arbitrarily nested?

A.

myArray. reduce ((prev, curr) => prev.concat(curr) [ ]);

B.

myArray. join (",").split (",");

C.

[ ] .concat {. . .myArray) ;

D.

myArray.flat(Infinity);

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 insidethe 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 eventto 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 scriptthat prevents the load event to be fired.