Summer Sale Limited Time 75% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code = simple75
Pass the Salesforce Developer JavaScript-Developer-I Questions and answers with Dumpstech
Given the code below:
01 function Person() {
02 this.firstName = ' John ' ;
03 }
04
05 Person.proto = {
06 job: x = > ' Developer '
07 });
08
09 const myFather = new Person();
10 const result = myFather.firstName + ' ' + myFather.job();
What is the value of result when line 10 executes?
Corrected code:
function Person() {
this.firstName = " John " ;
}
Person.prototype = {
job: x = > " Developer "
};
const myFather = new Person();
const result = myFather.firstName + " " + myFather.job();
What is the value of result after line 10 executes?
A developer has a fizzbuzz function that, when passed in a number, returns the following:
' fizz ' if the number is divisible by 3.
' buzz ' if the number is divisible by 5.
' fizzbuzz ' if the number is divisible by both 3 and 5.
Empty string if the number is divisible by neither 3 nor 5.
Which two test cases properly test scenarios for the fizzbuzz function?
A 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 team has already built using HTML, CSS, and JavaScript.
Which three benefits of Node.js can the developer use to persuade their manager?
Refer to the code below:
01 async function functionUnderTest(isOK) {
02 if (isOK) return ' OK ' ;
03 throw new Error( ' not OK ' );
04 }
Which assertion accurately tests the above code?
Code:
01 const sayHello = (name) = > {
02 console.log( ' Hello ' , name);
03 };
04
05 const world = () = > {
06 return ' World ' ;
07 };
08
09 sayHello(world);
This does not print " Hello World " .
What change is needed?
Given the code:
01 function GameConsole(name) {
02 this.name = name;
03 }
04
05 GameConsole.prototype.load = function(gamename) {
06 console.log( ' ${this.name} is loading a game: ${gamename}.... ' );
07 }
08
09 function Console16bit(name) {
10 GameConsole.call(this, name);
11 }
12
13 Console16bit.prototype = Object.create(GameConsole.prototype);
14
15 // insert code here
16 console.log( ' ${this.name} is loading a cartridge game: ${gamename}.... ' );
17 }
18
19 const console16bit = new Console16bit( ' SNEGeneziz ' );
20 console16bit.load( ' Super Monic 3x Force ' );
What should a developer insert at line 15?
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?
A developer has an isDeg function that takes one argument, pts. They want to schedule the function to run every minute.
What is the correct syntax for scheduling this function?
Given the code below:
01 function Person(name, email) {
02 this.name = name;
03 this.email = email;
04 }
05
06 const john = new Person( ' John ' , ' john@email.com ' );
07 const jane = new Person( ' Jane ' , ' jane@email.com ' );
08 const emily = new Person( ' Emily ' , ' emily@email.com ' );
09
10 let usersList = [john, jane, emily];
Which method can be used to provide a visual representation of the list of users and to allow sorting by the name or email attribute?