Salesforce Certified JavaScript Developer (JS-Dev-101) - JavaScript-Developer-I Exam Practice Test

A developer copied a JavaScript object:
01 function Person() {
02 this.firstName = " John " ;
03 this.lastName = " Doe " ;
04 this.name = () = > `${this.firstName},${this.lastName}`;
05 }
06
07 const john = new Person();
08 const dan = Object.assign({}, john);
09 dan.firstName = ' Dan ' ;
How does the developer access dan ' s firstName, lastName?
Correct Answer: D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
01 function Animal(size, type) {
02 this.type = type || ' Animal ' ;
03 this.canTalk = false;
04 }
05
06 Animal.prototype.speak = function() {
07 if (this.canTalk) {
08 console.log( " It spoke! " );
09 }
10 };
11
12 let Pet = function(size, type, name, owner) {
13 Animal.call(this, size, type);
14 this.size = size;
15 this.name = name;
16 this.owner = owner;
17 }
18
19 Pet.prototype = Object.create(Animal.prototype);
20 let pet1 = new Pet();
Given the code above, which three properties are set for pet1?
Correct Answer: B,D,E
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
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?
(With corrected typing errors: node_inspect # node inspect, node_start_inspect # node start inspect.)
Correct Answer: A
Which statement accurately describes an aspect of promises?
Correct Answer: B
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
A developer removes the HTML class attribute from the checkout button, so now it is simply:
< button > Checkout < /button >
There is a test to verify the existence of the checkout button, however it looks for a button with class= " blue "
. The test fails because no such button is found.
Which type of test category describes this test?
Correct Answer: B
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
A developer publishes a new version of a package with bug fixes but no breaking changes. The old version number was 2.1.1.
What should the new package version number be based on semantic versioning?
Correct Answer: A
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Given the following code:
01 let x = null;
02 console.log(typeof x);
What is the output of line 02?
Correct Answer: C
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Refer to the following code:
01 class Ship {
02 constructor(size) {
03 this.size = size;
04 }
05 }
06
07 class FishingBoat extends Ship {
08 constructor(size, capacity){
09 //Missing code
10 this.capacity = capacity;
11 }
12 displayCapacity() {
13 console.log( ' The boat has a capacity of ${this.capacity} people. ' );
14 }
15 }
16
17 let myBoat = new FishingBoat( ' medium ' , 10);
18 myBoat.displayCapacity();
Which statement should be added to line 09 for the code to display
The boat has a capacity of 10 people?
Correct Answer: C
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
A developer wants to advocate for a mature, well-supported web framework/library instead of a new one (Minimalist.js).
Which two should be recommended?
Correct Answer: A,C
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
0
0
0
0