Use Real JavaScript-Developer-I Dumps - Salesforce Correct Answers updated on 2021
Salesforce Developer JavaScript-Developer-I Exam Practice Dumps
NEW QUESTION 64
Refer to the code below:
What is the value of result when Promise. race executes?
- A. Car 1 crashed the race
- B. Car 3 completed the race
- C. Car 2 completed the race
- D. Race is cancelled.
Answer: A
NEW QUESTION 65
Given the following code:
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on the page is clicked?
- A. Event,target.nodename == 'BUTTON"
- B. Event, clicked
- C. o.nodeTarget == this
- D. button.addEventListener ( 'click')
Answer: A
NEW QUESTION 66
Given the HTML below:
Which statement adds the priority-account CSS class to the Unversal Containers row?
- A. Document. getElementById ( 'row-uc') addClass ( ' priority-account');
- B. Document. queryselector ('# row-uc') ,classes. Push (' priority-account');
- C. Document. querySelectorAll ( '# row-uc ') .classList. add ('priority-account');
- D. Document. querySelector ( 'row-uc') . classList. Add ( 'pariority-account') ;
Answer: D
NEW QUESTION 67
Given the code below:
What is the expected output?
- A. Line 08 throws an error, therefore line 09 is never executed.
- B. Both lines 08 and 09 are executed, and the variables are outputted.
- C. Line 08 outputs the variable, but line 09 throws an error.
- D. Both lines 06 and 09 are executed, but the values outputted are undefined.
Answer: C
NEW QUESTION 68
Refer to the expression below:
Let x = ('1' + 2) == (6 + 2) ;
How should this expression be modified to ensure that a evaluated to false?
- A. Let x = (1' + '2') == (6 + 2) ;
- B. Let x = (1' + '2') === (6 / 2) ;
- C. Let x = (1' + '2') == ('6' / 2) ;
- D. Let x = (1' + '2') === (6 + 2) ;
Answer: D
NEW QUESTION 69
Refer to the code below:
What is the output if this function when called with an empty array?
- A. Return 10
- B. Retruns 0
- C. Return NaN
- D. Throws an error
Answer: A
NEW QUESTION 70
Which JavaScript method can be used to serialize an object into a string and deserialize a JSON string into an object, respectively?
- A. JSON.Stringify and JSON.parse
- B. JSON,serialize and JSON,desrialize
- C. JSON.encode and JSON decode
- D. JSON.parse and JSON deserialize
Answer: B
NEW QUESTION 71
A developer has code that calculates a restaurant bill, but generates incorrect answers while testing the code.
Which option allows the developer to step into each function execution within calculateBill?
- A. Calling the console. Trace( total ) method on line 03.
- B. Using the debugger command on line 03.
- C. Using the debugger command on line 05.
- D. Wrapping findsubtotal in a console .log method.
Answer: B
NEW QUESTION 72
Which function should a developer use to repeatedly execute code at a fixed time interval?
- A. setTimeout
- B. setInterim
- C. setInterval
- D. setPeriod
Answer: C
NEW QUESTION 73
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.on ('error', (error) => {
console.log('ERROR', error);
}); - B. Server.error ((server) => {
console.log('ERROR', error);
}); - C. Try{
server.start();
} catch(error) { - D. Server.catch ((server) => {
console.log('ERROR', error);
});
Answer: A
Explanation:
console.log('ERROR', error);
}
NEW QUESTION 74
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
NEW QUESTION 75
Refer to the following array:
Let arr1 = [ 1, 2, 3, 4, 5 ];
Which two lines of code result in a second array, arr2 being created such that arr2 is not a reference to arr1?
- A. Let arr2 = arr1.sort();
- B. Let arr2 = arr1;
- C. Let arr2 = Array.from(arr1);
- D. Let arr2 = arr1.slice(0, 5);
Answer: C,D
NEW QUESTION 76
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 resolved or rejected
- C. When rejected
- D. When resolved and settled
Answer: B
NEW QUESTION 77
Given the code below:
What happens when the code executes?
- A. The ur1 variable has global scope and line 02 executes correctly.
- B. The ur1 variable has global scope and line 02 throws an error.
- C. The ur1 variable has local scope and line 02 executes correctly.
- D. The ur1 variables has local scope and line 02 throws an error.
Answer: A
NEW QUESTION 78
A developer is wondering whether to use, promise, then or provise, catch especially when a promise throws an error.
Which two promises are rejected? Choose 2 answers
- A. Promise , reject ('Cool error here ') , catch (error => console ,error (error));
- B. Promise, rejected (Cool error here'), then (error => console (error ));
- C. New promise (() => (throw 'Cool error here ')) , then ((null, error => console, (error)));
- D. New Promise((resolve, reject) => ( throw 'Cool error here')) .catch (error => console (error ));
Answer: C,D
NEW QUESTION 79
......
Get ready to pass the JavaScript-Developer-I Exam right now using our Salesforce Developer Exam Package: https://www.passexamdumps.com/JavaScript-Developer-I-valid-exam-dumps.html
JavaScript-Developer-I Premium Files Test pdf - Free Dumps Collection: https://drive.google.com/open?id=1o_2y97tNoJ-6tp6faLUde9Mv06ti3ARr
