4.7/5 - (27 votes)

[2022] JavaScript-Developer-I PDF Questions – Perfect Prospect To Go With Actualtests4sure Practice Exam

Salesforce JavaScript-Developer-I Pdf Questions – Outstanding Practice To your Exam

NO.34 Refer to the HTML below:
<div id=”main”>
<ul>
<li>Leo</li>
<li>Tony</li>
<li>Tiger</li>
</ul>
</div>
Which JavaScript statement results in changing ” Tony” to “Mr. T.”?

 
 
 
 

NO.35 A developer wrote 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 or 5.
Which two test cases will properly test scenarios for the fizzbuzz function?
Choose 2 answers

 
 
 
 

NO.36 A developer publishes a new version of a package with new feature that do not break backward compatibility. The previous version number was 1.1.3.
Following semantic versioning format, what should the new package version number be?

 
 
 
 

NO.37 Which JavaScript method can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?

 
 
 
 

NO.38 Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject(“fraction > 0.5, ” + fraction);
resolve(fraction);
})
.then(() =>console.log(“resolved”))
.catch((error) => console.error(error))
.finally(() => console.log(” when am I called?”));

When does Promise.finally on line 08 get called?

 
 
 
 

NO.39 A class was written to represent items for purchase in an online store, and a second class representing items that are on sale at a discounted price. The constructor sets the name to the first value passed in. The pseudocode is below:

There is a new requirement for a developer to implement a description method that will retrun a brief description for item and saleitem.

What is the out when executing the code above?

 
 
 
 

NO.40 Given the following code:
document.body.addEventListener(‘ click ‘, (event) => {
if (/* CODE REPLACEMENT HERE */) {
console.log(‘button clicked!’);
)
});
Which replacement for the conditional statement on line 02 allows a developer to
correctly determine that a button on page is clicked?

 
 
 
 

NO.41 Refer to the code below:
new Promise((resolve, reject) => {
const fraction = Math.random();
if( fraction >0.5) reject(“fraction > 0.5, ” + fraction);
resolve(fraction);
})
.then(() =>console.log(“resolved”))
.catch((error) => console.error(error))
.finally(() => console.log(” when am I called?”));

When does Promise.finally on line 08 get called?

 
 
 
 

NO.42 Refer to the code snippet:

A developer writes this code to return a message to a user attempting to register a new username. If the username is available, a variable named msg is declared and assigned a value on line 03.
What is the return of msg when getivelibilityMessage (” bewUserName’) is executed and getAvailability (”newUserName”) returns false?

 
 
 
 

NO.43 A developer creates a new web server that uses Node.js. It imports a server library that uses events and callbacks for handling server functionality.
The server library is imported with require and is made available to the code by a variable named server. The developer wants to log any issues that the server has while booting up.
Given the code and the information the developer has, which code logs an error at boot time with an event?
A)

B)

C)

D)

 
 
 
 

NO.44 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 inside the 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.

 
 
 
 

NO.45 Refer to the code below:
Let searchString = ‘ Look for this ‘;
Which two options remove the whitespace from the beginning of searchString? Choose 2 answers

 
 
 
 

NO.46 Refer to the code below:
What is the output after the code executes?

 
 
 
 

NO.47 A developer is asked to fix some bugs reported by users. To do that, the developer adds
a breakpoint for debugging.
Function Car (maxSpeed, color){
This.maxspeed =masSpeed;
This.color = color;
Let carSpeed = document.getElementById(‘ CarSpeed’);
Debugger;
Let fourWheels =new Car (carSpeed.value, ‘red’);
When the code execution stops at the breakpoint on line 06, which two types of information are
available in the browser console ?
Choose 2 answers:

 
 
 
 

NO.48 A developer needs to test this functions:

Which two assert statements are valid tests for this function?

 
 
 
 

NO.49 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 inside the 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.

 
 
 
 

NO.50 Refer to the code below:

Which code change should be made for the console to log only Row log when ‘Click mel’ is clicking?

 
 
 
 

NO.51 A developer receives a comment from the Tech Lead that the code given below has error:
const monthName = ‘July’;
const year = 2019;
if(year === 2019) {
monthName = ‘June’;
}
Which line edit should be made to make this code run?

 
 
 
 

NO.52 Refer to the code below:
<html lang=”en”>
<table onclick=”console.log(Table log’);”>
<tr id=”row1″>
<td>Click me!</td>
</tr>
<table>
<script>
function printMessage(event) {
console.log(‘Row log’);
}
Let elem = document.getElementById(‘row1’);
elem.addEventListener(‘click’, printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Row log when ‘Click me! ‘ is clicked?

 
 
 
 

NO.53 A developer is asked to fix some bugs reported by users. To do that, the developer adds a breakpoint for debugging.

When the code execution stops at the breakpoint on line 06, which two types of information are available In the browser console? Choose 2 answers

 
 
 
 

NO.54 A developer is setting up a new Node.js server with a client library that is built using events and callbacks.
The library:
* Will establish a web socket connection and handle receipt of messages to the server
* Will be imported with require, and made available with a variable called ws.
The developer also wants to add error logging if a connection fails.
Given this information, which code segment show the correct way to set up a client two events that listen at execution time?
A)

B)

C)

D)

 
 
 
 

Online Questions – Outstanding Practice To your JavaScript-Developer-I Exam: https://www.actualtests4sure.com/JavaScript-Developer-I-test-questions.html

         

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

Enter the text from the image below