[2022] Valid JavaScript-Developer-I test answers & Salesforce JavaScript-Developer-I exam pdf
Verified JavaScript-Developer-I dumps Q&As - Pass Guarantee or Full Refund
What is the duration, language, and format of Salesforce JavaScript-Developer-I Exam
- This exam is offered in only English.
- There is a time limit of 105 minutes for the exam.
- The type of questions is Multiple Choice and situation-based questions.
- Passing score 65%
- This exam consists of 60 questions
NEW QUESTION 61
Which two console logs outputs NaN ?
Choose 2 answers
- A. console.log(10/0);
- B. console.log(10/ Number('5'));
- C. console.log(parseInt('two'));
- D. console.log(10/ ''five);
Answer: C,D
NEW QUESTION 62
Refer to the code below:
A developer uses a client that makes a GET request that uses a promise to handle the request, getRequest returns a promise.
Which code modification can the developer make to gracefully handle an error?
A)
B)
C)
D)
- A. Option A
- B. Option D
- C. Option C
- D. Option B
Answer: A
NEW QUESTION 63
Refer to code below:
console.log(0);
setTimeout(() => (
console.log(1);
});
console.log(2);
setTimeout(() => {
console.log(3);
), 0);
console.log(4);
In which sequence will the numbers be logged?
- A. 02413
- B. 02431
- C. 0
- D. 01234
Answer: A
NEW QUESTION 64
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. Try{
server.start();
} catch(error) {
console.log('ERROR', error);
} - D. Server.on ('error', (error) => {
console.log('ERROR', error);
});
Answer: D
NEW QUESTION 65
Refer to the code below:
function foo () {
const a =2;
function bat() {
console.log(a);
}
return bar;
}
Why does the function bar have access to variable a ?
- A. Prototype chain
- B. Hoisting
- C. Outer function's scope
- D. Inner function's scope
Answer: C
NEW QUESTION 66
The developer wants to test the array shown:
const arr = Array(5).fill(0)
Which two tests are the most accurate for this array ?
Choose 2 answers:
- A. console.assert(arr[0] === 0 && arr[ arr.length] === 0);
- B. console.assert (arr.length >0);
- C. console.assert( arr.length === 5 );
- D. arr.forEach(elem => console.assert(elem === 0)) ;
Answer: C,D
NEW QUESTION 67
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. 1 2 5 3 4
- C. 2 5 1 3 4
- D. 1 2 4 3 5
Answer: C
NEW QUESTION 68
Refer to the code below:
let productSKU = '8675309,;
A developer has a requirement to generate SKU numbers that are always 10 characters log, starting with 'sku', and padded with zeros.
Which statement assigned the value skuooooooooo86675309?
- A. productSKU = productSKU. Padstart (19, '0' padstart ('sku') ;
- B. productSKU = productSKU. PadEnd (16, '0' padstart (19, 'sku') ;
- C. productSKU = productSKU. Padstart (16, '0' padstart (19, 'sku') ;
- D. productSKU = productSKU. PadEnd (16, '0' padstart ('sku') ;
Answer: C
NEW QUESTION 69
Refer to the code below:
Which statement allows a developer to cancel the scheduled timed function?
- A. removeTimeout (timeFunction) ;
- B. ClearTimeout (timerId) ;
- C. ClearTimeout (timeFunction);
- D. removeTimeout (timerId) ;
Answer: A
NEW QUESTION 70
Given the requirement to refactor the code above to JavaScript class format, which class definition is correct?
A)
B)
C)
D)
- A. Option A
- B. Option D
- C. Option C
- D. Option B
Answer: A
NEW QUESTION 71
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?
- A. ''newUsername''
- B. ''Username available''
- C. undefined
- D. ''msg is not defined''
Answer: C
NEW QUESTION 72
A developer has the function, shown below, that is called when a page loads.
Where can the developer see the log statement after loading the page in the browser?
- A. Browser javaScript console
- B. On the webpage
- C. Browser performance tools
- D. Terminal running the web server.
Answer: A
NEW QUESTION 73
Given the following code:
What is the logged by the first four log statements?
- A. 0 1 2 2
- B. 0 1 2 3
- C. 0 1 1 2
- D. 0 0 1 2
Answer: C
NEW QUESTION 74
A developer implements and calls the following code when an application state change occurs:
If the back button is clicked after this method is executed, what can a developer expect?
- A. The page is navigated away from and previous page in the browser's history is loaded.
- B. A popstate event is fired with a state properly that details the application's last state.
- C. A navigate event is fired with a state properly that details previous application state.
- D. The page reloads and all JavaScript is reinitialized.
Answer: A
NEW QUESTION 75
Refer to the code below:
What is result of the code block?
- A. An error is thrown.
- B. The console logs only 'flag',
- C. The console logs flag' and then an error is thrown.
- D. The console logs 'flag' and another flag',
Answer: C
NEW QUESTION 76
A developer is creating a simple webpage with a button. When a user clicks this button for the first time, a message is displayed.
The developer wrote the JavaScript code below, but something is missing. The message gets displayed every time a user clicks the button, instead of just the first time.
01 function listen(event) {
02 alert ( 'Hey! I am John Doe') ;
03 button.addEventListener ('click', listen);
Which two code lines make this code work as required?
Choose 2 answers
- A. On line 06, add an option called once to button.addEventListener().
- B. On line 02, use event.first to test if it is the first execution.
- C. On line 04, use button.removeEventListener(' click" , listen);
- D. On line 04, use event.stopPropagation ( ),
Answer: A,C
NEW QUESTION 77
Refer to the following code that performs a basic mathematical operation on a provided input:
function calculate(num) {
Return (num +10) / 3;
}
How should line 02 be written to ensure that x evaluates to 6 in the line below?
Let x = calculate (8);
- A. Return (Number (num +10 ) / 3;
- B. Return Number((num +10) /3 );
- C. Return Number(num + 10) / 3;
- D. Return Integer(num +10) /3;
Answer: A
NEW QUESTION 78
Cloud Kicks has a class to represent items for sale in an online store, as shown below:
Class Item{
constructor (name, price){
this.name = name;
this.price = price;
}
formattedPrice(){
return 's' + String(this.price);}}
A new business requirement comes in that requests a ClothingItem class that should have all of the properties and methods of the Item class but will also have properties that are specific to clothes.
Which line of code properly declares the clothingItem class such that it inherits from Item?
- A. Class ClothingItem {
- B. Class ClothingItem implements Item{
- C. Class ClothingItem super Item {
- D. Class ClothingItem extends Item {
Answer: D
NEW QUESTION 79
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?
Which three benefits of Node.js can the developer use to persuade their manager?
- A. Executes server-side JavaScript code to avoid learning a new language.
- B. Installs with its own package manager to install and manage third-party libraries.
- C. Uses non-blocking functionality for performant request handling
- D. Performs a static analysis can code before execution to look for runtime errors.
- E. Ensure stability with one major release every few years.
Answer: D
NEW QUESTION 80
Refer to the code below:
What is the output of this function when called with an empty array?
- A. Return Infinity
- B. Return 5
- C. Return 0
- D. Return NaN
Answer: B
NEW QUESTION 81
Which option is true about the strict mode in imported modules?
- A. Add the statement use non-strict, before any other statements in the module to enable
not-strict mode. - B. Imported modules are in strict mode whether you declare them as such or not.
- C. Add the statement use strict =false; before any other statements in the module to enable
not- strict mode. - D. You can only reference notStrict() functions from the imported module.
Answer: D
NEW QUESTION 82
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
The developer needs to insert a code statement in the location shown. The code
statement has these requirements:
1. Does require an import
2. Logs an error when the boolean statement evaluates to false
3. Works in both the browser and Node.js
Which meet the requirements?
- A. console.error(number % 2 === 0);
- B. console.debug(number % 2 === 0);
- C. assert (number % 2 === 0);
- D. console.assert(number % 2 === 0);
Answer: A
NEW QUESTION 83
......
JavaScript-Developer-I Exam Questions – Valid JavaScript-Developer-I Dumps Pdf: https://www.test4engine.com/JavaScript-Developer-I_exam-latest-braindumps.html
JavaScript-Developer-I PDF Dumps Recently Updated Questions: https://drive.google.com/open?id=1IAMuVSx-Lg5Hs5M7TT2WA-swzh4X1ax6