ExamGecko
Home Home / Salesforce / Certified JavaScript Developer I

Salesforce Certified JavaScript Developer I Practice Test - Questions Answers, Page 18

Question list
Search
Search

List of questions

Search

Related questions











bar, awesome is a popular JavaScript module. the versions publish to npm are:

Teams at Universal Containers use this module in a number of projects. A particular project has the package, json definition below.

A developer runs this command: npm install.

Which version of bar .awesome is installed?

A.
1.3.1
A.
1.3.1
Answers
B.
1.3.5
B.
1.3.5
Answers
C.
The command fails, because version 130 is not found
C.
The command fails, because version 130 is not found
Answers
D.
1.4.0
D.
1.4.0
Answers
Suggested answer: B

Given the expressions var1 and var2, what are two valid ways to return the concatenation of the two expressions and ensure it is string? Choose 2 answers

A.
var1 + var2
A.
var1 + var2
Answers
B.
var1.toString ( ) var2.toString ( )
B.
var1.toString ( ) var2.toString ( )
Answers
C.
String (var1) .concat (var2)
C.
String (var1) .concat (var2)
Answers
D.
string.concat (var1 +var2)
D.
string.concat (var1 +var2)
Answers
Suggested answer: B, D

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
A.
node -i server.js
Answers
B.
node inspect server,js
B.
node inspect server,js
Answers
C.
node server,js inspect
C.
node server,js inspect
Answers
D.
node start inspect server,js
D.
node start inspect server,js
Answers
Suggested answer: B

Refer to the following object.

How can a developer access the fullName property for dog?

A.
Dog.fullName
A.
Dog.fullName
Answers
B.
Dog.fullName ( )
B.
Dog.fullName ( )
Answers
C.
Dog, get, fullName
C.
Dog, get, fullName
Answers
D.
Dog, function, fullName
D.
Dog, function, fullName
Answers
Suggested answer: A

Given the following code:

What will be the first four numbers logged?

A.
0012
A.
0012
Answers
B.
0112
B.
0112
Answers
C.
0122
C.
0122
Answers
D.
0123
D.
0123
Answers
Suggested answer: B

There is a new requirement for a developer to implement a currPrice method that will return the current price of the item or sales..

What is the output when executing the code above

A.
50Uncaught TypeError: saleItem,desrcription is not a function5080
A.
50Uncaught TypeError: saleItem,desrcription is not a function5080
Answers
B.
50805072
B.
50805072
Answers
C.
508072
C.
508072
Answers
D.
5080Uncaught Reference Error:this,discount is undefined72
D.
5080Uncaught Reference Error:this,discount is undefined72
Answers
Suggested answer: B

A developer copied a JavaScript object:

How does the developer access dan's forstName,lastName? Choose 2 answers

A.
dan,name
A.
dan,name
Answers
B.
dan,firstname ( ) + dan, lastName ( )
B.
dan,firstname ( ) + dan, lastName ( )
Answers
C.
dan, firstName = dan.lastName
C.
dan, firstName = dan.lastName
Answers
D.
dan,name ( )
D.
dan,name ( )
Answers
Suggested answer: C, D

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?

A.
window.location
A.
window.location
Answers
B.
_filename
B.
_filename
Answers
C.
_dirname
C.
_dirname
Answers
D.
this.path
D.
this.path
Answers
Suggested answer: B

A developer at Universal Containers is creating their new landing page based 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 Is loaded 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);
A.
windows,addEventListener('load', personalizeWebsiteContent);
Answers
B.
windows,addEventListener('DOMContent Loaded ', personalizeWebsiteContent);
B.
windows,addEventListener('DOMContent Loaded ', personalizeWebsiteContent);
Answers
C.
windows,addEventListener('onload', personalizeWebsiteContent);
C.
windows,addEventListener('onload', personalizeWebsiteContent);
Answers
D.
windows,addEventListener('onDOMCContentLoaded', personalizeWebsiteContent);
D.
windows,addEventListener('onDOMCContentLoaded', personalizeWebsiteContent);
Answers
Suggested answer: A

Refer to the code below:

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

A.
Return 0
A.
Return 0
Answers
B.
Return 5
B.
Return 5
Answers
C.
Return NaN
C.
Return NaN
Answers
D.
Return Infinity
D.
Return Infinity
Answers
Suggested answer: B
Total 224 questions
Go to page: of 23