JavaScript-Developer-I Practice Test Questions Updated 160 Questions
Salesforce JavaScript-Developer-I Dumps - Secret To Pass in First Attempt
How to book the Salesforce JavaScript-Developer-I Exam
There are the following steps for registering the Salesforce JavaScript Developer I exam. Step 1: Visit Salesforce Exam Registration Step 2: Signup/Login to Salesforce account Step 4: Select Date, time and confirm with the payment method
NEW QUESTION 89
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 boost with an event?
- A. Server.catch ((server) => {
console.log('ERROR', error);
}); - B. Server.error ((server) => {
console.log('ERROR', error);
}); - C. Server.on ('error', (error) => {
console.log('ERROR', error);
}); - D. Try{
server.start();
} catch(error) {
Answer: C
Explanation:
console.log('ERROR', error);
}
NEW QUESTION 90
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 we.
The developer also wants to add error logging if a connection fails.
Given this info, which code segment shows the correct way to set up a client with two events that listen at execution time?
- A. ws.on ('connect', ( ) => {
console.log('connected to client'); ws.on('error', (error) => { console.log('ERROR' , error); });
}); - B. ws.connect (( ) => {
console.log('connected to client'); }).catch((error) => { console.log('ERROR' , error); }}; - C. try{
ws.connect (( ) => {
console.log('connected to client'); });
} catch(error) { console.log('ERROR' , error); };
} - D. ws.on ('connect', ( ) => { console.log('connected to client'); }}; ws.on('error', (error) => { console.log('ERROR' , error); }};
Answer: D
NEW QUESTION 91
Refer to the code below:
Which statement allows a developer to cancel the scheduled timed function?
- A. removeTimeout (timeFunction) ;
- B. ClearTimeout (timeFunction);
- C. ClearTimeout (timerId) ;
- D. removeTimeout (timerId) ;
Answer: A
NEW QUESTION 92
Refer to the HTML below:
<p> The current status of an order: < span> id='' status '> In progress < /span> < /p> Which JavaScript Statement changes the text 'In Progress' to Completed'?
- A. Document, getElementById (''# status''), innerHTML = 'Completed' ;
- B. Document, getElementById (status'') , value = completed' ;
- C. Document, getElementById (''status''), innerHTML = 'Completed' ;
- D. Document, getElementById ('',status''), innerHTML = 'Completed' ;
Answer: C
NEW QUESTION 93
Which JavaScript method can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
- A. JSON.encode and JSON decode
- B. JSON,serialize and JSON,desrialize
- C. JSON.parse and JSON deserialize
- D. JSON.Stringify and JSON.parse
Answer: B
NEW QUESTION 94
Which three options show valid methods for creating a fat arrow function? Choose 3 answers
- A. (x, y, z) => (console.log ('executed') ;)
- B. X => {console.log {'executed'} ; }
- C. X, y, z => ( console.log ('executed') ; )
- D. { } => { console.log (executed') ; )
- E. ( ) => { console.log (' executed') ; )
Answer: A,B,E
NEW QUESTION 95
Universal Containers recently its new landing page to host crowd-function 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 included the same ad-library-item class. They are hidden by default, and they are randomly displayed while the user navigation through the page.
Tired of all the ads, what can the developer do to temporarily and quickly remove them?
- A. Use the DOM inspector to remove all the elements containing the call ad-library -item.
- B. Use the browser console to execute a script that prevents the load event to be fired.
- C. Use the browser console to execute a script that removes all the elements containing the class ad-library-item.
- D. Use the DOM inspector to prevent the load event to be fired.
Answer: C
NEW QUESTION 96
A team that works on a big project uses npm to deal with projects dependencies.
A developer added a dependency does not get downloaded when they execute npm install.
Which two reasons could be possible explanations for this?
Choose 2 answers
- A. The developer missed the option --add when adding the dependency.
- B. The developer added the dependency as a dev dependency, and NODE_ENV is set to production.
- C. The developer missed the option --save when adding the dependency.
- D. The developer added the dependency as a dev dependency, and NODE_ENV Is set to production.
Answer: B,C,D
NEW QUESTION 97
Which code statement below correctly persists an objects in local Storage ?
- A. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.persist(storageKey, jsObject);
} - B. const setLocalStorage = (storageKey, jsObject) => {
window.localStorage.setItem(storageKey, JSON.stringify(jsObject));
} - C. const setLocalStorage = ( jsObject) => {
window.localStorage.setItem(jsObject);
} - D. const setLocalStorage = ( jsObject) => {
window.localStorage.connectObject(jsObject));
}
Answer: B
Explanation:
NEW QUESTION 98
A developer has two ways to write a function:
After deciding on an option, the developer creates 1000 monster objects.
How many growl methods are created with Option A and Option B?
- A. 1000 growl methods are created for Option A. 1 growl method is created for Option B.
- B. 1000 growl methods are created regardless of which option is used.
- C. 1 growl method is created regardless of which option is used.
- D. 1 growl method is created for Option A. 1000 growl methods are created for Option B.
Answer: A
NEW QUESTION 99
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?
- A. WHen resolved
- B. When rejected
- C. When resolved or rejected
- D. When resolved and settled
Answer: C
NEW QUESTION 100
A developer receives a comment from the Tech lead that the code below gives an error.
Which line edit should be made to make this code run?
- A. 03 if (year == 2019) (
- B. 02 let year = 2019 ;
- C. 01 let monthname = 'July ';
- D. 02 const year = 2020;
Answer: D
NEW QUESTION 101
Which statement parses successfully?
- A. JSON.parse ("foo");
- B. JSON.parse (""foo'");
- C. JSON. parse (""foo"');
- D. JSON.parse ("foo");
Answer: C
NEW QUESTION 102
Refer to the code below:
When does promise. Finally on line 08 get called?
- A. When rejected
- B. When resolved
- C. When resolved or rejected
- D. When resolved and settled
Answer: C
NEW QUESTION 103
Which three actions can be done using the JavaSript browser console?
Choose 3 answer
- A. Run code a that is not related to the page.
- B. View, change, and debug the JavaScript code of the page.
- C. View and change security cookies
- D. Display a report showing the performance of a page.
- E. View and change the DOM of the page.
Answer: A,B,E
NEW QUESTION 104
In which situation should a developer include a try... catch block around their function call?
- A. The function has an error that should not be silenced.
- B. The function contains scheduled code.
- C. The function might raise a runtime error that needs to be handled.
- D. The function results in an out of memory issue.
Answer: C
NEW QUESTION 105
A developer writes the code below to calculate the factorial of a given number.
What is the result of executing line 04?
- A. RuntimeError
- B. 0
- C. -Infinity
- D. 1
Answer: A
NEW QUESTION 106
......
Salesforce JavaScript-Developer-I Exam Dumps [2022] Practice Valid Exam Dumps Question: https://www.surepassexams.com/JavaScript-Developer-I-exam-bootcamp.html
JavaScript-Developer-I Dumps - Grab Out For [NEW-2022] Salesforce Exam: https://drive.google.com/open?id=1pe5HG2ebYufhXgt9TsLVGZ9jCGKV6ue1