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

Exam JavaScript-Developer-I Premium Access

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

Practice at least 50% of the questions to maximize your chances of passing.
Viewing page 1 out of 5 pages
Viewing questions 1-10 out of questions
Questions # 1:

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?

Options:

A.

Error: myFather.job is not a function

B.

undefined Developer

C.

John Developer

D.

John undefined

Questions # 2:

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?

Options:

A.

" John Developer "

B.

" John undefined "

C.

Error: myFather.job is not a function

D.

" undefined Developer "

Questions # 3:

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?

Options:

A.

let res = fizzbuzz(3);

console.assert(res === ' buzz ' );

B.

let res = fizzbuzz(15);

console.assert(res === ' fizzbuzz ' );

C.

let res = fizzbuzz(NaN);

console.assert(isNaN(res));

D.

let res = fizzbuzz(Infinity);

console.assert(res === ' ' );

Questions # 4:

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?

Options:

A.

Executes server-side JavaScript code to avoid learning a new language.

B.

Performs a static analysis on code before execution to look for runtime errors.

C.

Uses non-blocking functionality for performant request handling.

D.

Ensures stability with one major release every few years.

E.

Installs with its own package manager to install and manage third-party libraries.

Questions # 5:

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?

Options:

A.

console.assert(await functionUnderTest(true), ' OK ' )

B.

console.assert(await (functionUnderTest(true), ' not OK ' ))

C.

console.assert(functionUnderTest(true), ' OK ' )

D.

console.assert(await functionUnderTest(true), ' not OK ' )

Questions # 6:

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?

Options:

A.

Change line 2 to console.log( ' Hello ' , name());

B.

Change line 7 to }();

C.

Change line 9 to sayHello(world)();

D.

Change line 5 to function world() {

Questions # 7:

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?

Options:

A.

Console16bit = Object.create(GameConsole.prototype).load = function(gamename) {

B.

Console16bit.prototype.load(gamename) = function() {

C.

Console16bit.prototype.load(gamename) {

D.

Console16bit.prototype.load = function(gamename) {

Questions # 8:

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?

Options:

A.

dan.firstName() + dan.lastName()

B.

dan.name()

C.

dan.name

D.

dan.firstName + dan.lastName

Questions # 9:

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?

Options:

A.

setInterval(isDeg( ' cat ' ), 60000);

B.

setInterval(isDeg, 60000, ' cat ' );

C.

setTimeout(isDeg, 60000, ' cat ' );

D.

setTimeout(isDeg( ' cat ' ), 60000);

Questions # 10:

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?

Options:

A.

console.table(usersList);

B.

console.group(usersList);

C.

console.groupCollapsed(usersList);

D.

console.info(usersList);

Viewing page 1 out of 5 pages
Viewing questions 1-10 out of questions