JavaScript-Developer-I | How Many Questions Of JavaScript-Developer-I Practice
Cause all that matters here is passing the Salesforce JavaScript-Developer-I exam. Cause all that you need is a high score of JavaScript-Developer-I Salesforce Certified JavaScript Developer I exam. The only one thing you need to do is downloading Exambible JavaScript-Developer-I exam study guides now. We will not let you down with our money-back guarantee.
Salesforce JavaScript-Developer-I Free Dumps Questions Online, Read and Test Now.
NEW QUESTION 1
Consider type coercion, what does the following expression evaluate to? True + 3 + ‘100’ + null
- A. 104
- B. 4100
- C. ‘3100null’
- D. ‘4100null’
Answer: D
NEW QUESTION 2
A developer wants to define a function log to be used a few times on a single-file JavaScript script.
01 // Line 1 replacement
02 console.log('"LOG:', logInput);
03 }
Which two options can correctly replace line 01 and declare the function for use? Choose 2 answers
- A. function leg(logInput) {
- B. const log(loginInput) {
- C. const log = (logInput) => {
- D. function log = (logInput) {
Answer: AC
NEW QUESTION 3
Refer to the code below:
1 let car1 = new promise((_, reject) =>
2 setTimeout(reject, 2000, “Car 1 crashed in”));
3 let car2 = new Promise(resolve => setTimeout(resolve, 1500, “Car 2 completed”));
4 let car3 = new Promise(resolve => setTimeout (resolve, 3000, “Car 3 Completed”));
5 Promise.race([car1, car2, car3]) 06 .then(value => (
07 let result = $(value) the race. `; 08 ))
9 catch( arr => (
10 console.log(“Race is cancelled.”, err); 11 ));
What is the value of result when Promise.race executes?
- A. Car 3 completed the race.
- B. Car 1 crashed in the race.
- C. Car 2 completed the race.
- D. Race is cancelled.
Answer: C
NEW QUESTION 4
Universal Containers (UC) notices that its application that allows users to search for accounts makes a network request each time a key is pressed. This results in too many requests for the server to handle.
Address this problem, UCdecides to implement a debounce function on string change handler.
What are three key steps to implement this debounce function? Choose 3 answers:
- A. If there is an existing setTimeout and the search string change, allow the existingsetTimeout to finish,and do not enqueue a new setTimeout.
- B. When the search string changes, enqueue the request within a setTimeout.
- C. Ensure that the network request has the property debounce set to true.
- D. If there is an existing setTimeout and the search string changes,cancel the existing setTimeout using the persisted timerId and replace it with a new setTimeout.
- E. Store the timeId of the setTimeout last enqueued by the search string change handle.
Answer: ABC
NEW QUESTION 5
A developer wants to leverage a module to print a price in pretty format, and has imported a method as shown below:
Import printPrice from‘/path/PricePrettyPrint.js’;
Based on the code, what must be true about the printPrice function of the PricePrettyPrint module for this import to work ?
- A. printPrice must be be a named export
- B. printPrice must be an all export
- C. printPrice must be the default export
- D. printPrice must be a multi exportc
Answer: C
NEW QUESTION 6
Refer to the code below? LetsearchString = ‘ look for this ’;
Which two options remove the whitespace from the beginning of searchString? Choose 2 answers
- A. searchString.trimEnd();
- B. searchString.trimStart();
- C. trimStart(searchString);
- D. searchString.replace(/*\s\s*/, ‘’);
Answer: BD
NEW QUESTION 7
Refer to the code below: Let textValue = ’1984’;
Which code assignment shows a correct way to convert this string to an integer?
- A. let numberValue = Number(textValue);
- B. Let numberValue = (Number)textValue;
- C. Let numberValue = textValue.toInteger();
- D. Let numberValue = Integer(textValue);
Answer: A
NEW QUESTION 8
Refer to the code below:
01 const server = require(‘server’);
02 /* Insert code here */
A developer imports a library that creates a web server.The imported library uses events and callbacks to start the servers
Which code should be inserted at the line 03 to set up an event and start the web server ?
- A. Server.start ();
- B. server.on(‘ connect ’ , ( port) => { console.log(‘Listening on ’ , port);})
- C. server()
- D. serve(( port) => (
- E. console.log( ‘Listening on ’, port) ;
Answer: B
NEW QUESTION 9
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 aweb 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.
- B.
- C.
- D.
Answer: C
NEW QUESTION 10
Which statement parses successfully?
- A. JSO
- B. parse (""foo"');
- C. JSON.parse (""foo'");
- D. JSON.parse ("foo");
- E. JSON.parse ("foo");
Answer: A
NEW QUESTION 11
Which two console logs outputs NaN? Choose 2 answers
- A. console.log(10/ Number(‘5’));
- B. console.log(parseInt(‘two’));
- C. console.log(10/ ‘’five);
- D. console.log(10/0);
Answer: BC
NEW QUESTION 12
Refer to the code below:
Why does the function bar have access to variable a ?
- A. Inner function’s scope
- B. Hoisting
- C. Outer function’s scope
- D. Prototype chain
Answer: C
NEW QUESTION 13
Given code below: setTimeout (() => ( console.log(1);
). 0);
console.log(2);
New Promise ((resolve, reject )) = > ( setTimeout(() => ( reject(console.log(3));
). 1000);
)).catch(() => ( console.log(4);
));
console.log(5);
What is logged to the console?
- A. 2 1 4 3 5
- B. 2 5 13 4
- C. 1 2 4 3 5
- D. 1 2 5 3 4
Answer: B
NEW QUESTION 14
Considering type coercion, what does the following expression evaluate to? True + ‘13’ + NaN
- A. ‘ 113Nan ’
- B. 14
- C. ‘ true13 ’
- D. ‘ true13NaN ’
Answer: D
NEW QUESTION 15
Which statement accurately describes an aspect of promises?
- A. Arguments for the callback function passed to .then() are optional.
- B. In a.then() function, returning results is not necessary since callbacks will catch the result of a previous promise.
- C. .then() cannot be added after a catch.
- D. .then() manipulates and returns the original promise.
Answer: A
NEW QUESTION 16
Giventhe code below:
const copy = JSON.stringify([ new String(‘ false ’), new Bollean( false ), undefined ]); What is the value of copy?
- A. -- [ \”false\” , { } ]-
- B. -- [ false, { } ]-
- C. -- [ \”false\” , false, undefined ]-
- D. -- [ \”false\” ,false, null ]-
Answer: D
NEW QUESTION 17
A developer has code that calculates a restaurant bill, but generates incorrectanswers while testing the code:
function calculateBill ( items ) { let total = 0;
total += findSubTotal(items); total += addTax(total);
total += addTip(total); return total;
}
Which option allows the developer to step into each function execution within calculateBill?
- A. Using the debugger command on line 05.
- B. Using the debugger command on line 03
- C. Calling the console.trace (total) method on line 03.
- D. Wrapping findSubtotal in a console.log() method.
Answer: A
NEW QUESTION 18
A developer needs to test this function:
01const sum3 = (arr) => (
02if (!arr.length) return 0,
03if (arr.length === 1) return arr[0],
04if (arr.length === 2) return arr[0]+ arr[1],
05 return arr[0] + arr[1] + arr[2],
06 );
Which two assert statements are valid tests for the function? Choose 2 answers
- A. console.assert(sum3(1, ‘2’)) == 12);
- B. console.assert(sum3(0)) == 0);
- C. console.assert(sum3(-3, 2 )) == -1);
- D. console.assert(sum3(‘hello’, 2, 3, 4)) === NaN);
Answer: AC
NEW QUESTION 19
A test has a dependency on database.query. During the test the dependency is replaced with an object called database with the method, query, that returns an array. The developer needs to verify how many times the method was called and the arguments used each time.
Which two test approaches describe the requirement? Choose 2 answers
- A. Integration
- B. Black box
- C. White box
- D. Mocking
Answer: CD
NEW QUESTION 20
Universal Containers (UC) just launched a new landing page, but users complain that the website is slow. A developer found some functions any that might cause this problem. To verify this, the developer decides to execute everything and log the time each of these three suspicious functions consumes.
Which function can the developer use to obtain the time spent by every one of the three functions?
- A. consol
- B. timeLog ()
- C. console.timeStamp ()
- D. console.trace()
- E. console.getTime ()
Answer: A
NEW QUESTION 21
......
https://www.downloadfreepdf.net/JavaScript-Developer-I-pdf-download.html (157 New Questions)