Exam Questions Answers Braindumps JavaScript-Developer-I Exam Dumps PDF Questions
Download Free Salesforce JavaScript-Developer-I Real Exam Questions
NEW QUESTION # 100
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. Performs a static analysis can code before execution to look for runtime errors.
- B. Ensure stability with one major release every few years.
- C. Executes server-side JavaScript code to avoid learning a new language.
- D. Uses non-blocking functionality for performant request handling
- E. Installs with its own package manager to install and manage third-party libraries.
Answer: A
NEW QUESTION # 101
Refer the code below.
x=3.14;
function myfunction() {
"use strict";
y=x;
}
z=x;
myFunction();
Answer:
Explanation:
See the Answer below in explanation:
Explanation
Z is equal to 3.14
Use strict has effect only on line 5.
Line 5 throws an error
NEW QUESTION # 102
Refer to the following code block:
What is the console output?
- A. > Better student Jackie got 100% on test.
- B. > Better student Jackie got 70% on test.
- C. > Uncaught Reference Error
- D. > Jackie got 70% on test.
Answer: B
NEW QUESTION # 103
Given HTML below:
<div>
<div id ="row-uc"> Universal Container</div>
<div id ="row-aa">Applied Shipping</div>
<div id ="row-bt"> Burlington Textiles </div>
</div>
Which statement adds the priority = account CSS class to the universal Containers row ?
- A. Document .querySelector('#row-uc').classList.add('priority-account');
- B. Document .queryElementById('row-uc').addclass('priority-account');
- C. Document .querySelectorALL('#row-uc').classList.add('priority-account');
- D. Document .querySelector('#row-uc').classes.push('priority-account');
Answer: B
NEW QUESTION # 104
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?
- A. This is a Scarf
This is a Shirt
This is a discounted Scard
This is a discounted Shirt - B. This is a Scarf
This is a Shirt
This is a Scarf
This is a discounted Shirt - C. This is a Scarf
Unicaught TypeError: saleitem, description is not a function
This is a Scarf
This is a discounted Shirt - D. This is a Scaf
Uncaught TypeError: saleItem, description is not a function
This is a Shirt
This is a discounted Shirt
Answer: B
NEW QUESTION # 105
Which three actions can be using the JavaScript browser console?
Choose 3 answers:
- A. Display a report showing the performance of a page.
- B. View and change DOM the page.
- C. Run code that is not related to page.
- D. view , change, and debug the JavaScript code of the page.
- E. View and change security cookies.
Answer: B,C,D
NEW QUESTION # 106
Which three options show valid methods for creating a fat arrow function? Choose 3 answers
- A. X => {console.log {'executed'} ; }
- B. X, y, z => ( console.log ('executed') ; )
- C. ( ) => { console.log (' executed') ; )
- D. (x, y, z) => (console.log ('executed') ;)
- E. { } => { console.log (executed') ; )
Answer: A,C,D
NEW QUESTION # 107
Refer to the code below:
Line 05 causes an error.
What are the values of greeting and salutation once code completes?
- A. Greeting is Goodbye and salutation is I say Hello.
- B. Greeting is Goodbye and salutation is Hello, Hello.
- C. Greeting is Hello and salutation is I say hello.
- D. Greeting is Hello and salutation is Hello, Hello.
Answer: D
NEW QUESTION # 108
Given the JavaScript below:
01 function filterDOM (searchString) {
02 const parsedSearchString = searchString && searchString.toLowerCase() ;
03 document.quesrySelectorAll(' .account' ) . forEach(account => (
04 const accountName = account.innerHTML.toLOwerCase();
05 account. Style.display = accountName.includes(parsedSearchString) ? /*Insert
code*/;
06 )};
07 }
Which code should replace the placeholder comment on line 05 to hide accounts that do
not match the search string?
- A. ' hidden ' : ' visible '
- B. ' visible ' : ' hidden '
- C. ' Block ' : ' none '
- D. ' name ' : ' block '
Answer: C
NEW QUESTION # 109
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: A
NEW QUESTION # 110
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. 1
- D. -Infinity
Answer: A
NEW QUESTION # 111
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 time a user clicks the button instead of just the first time.
Which two code lines make this code work as required? Choose 2 answers
- A. On line 04, use event .stopPropagetion ( );
- B. On line 06, ad an option called once to button. addEventlistener ( ).
- C. On line 02, use event.first to test if it is the first execution.
- D. On line 04, use button. removeEventlistener ('click', listen );
Answer: B,D
NEW QUESTION # 112
Refer to the code below:
Line 05 causes an error.
What are the values of greeting and salutation once code completes?
- A. Greeting is Goodbye and salutation is I say Hello.
- B. Greeting is Goodbye and salutation is Hello, Hello.
- C. Greeting is Hello and salutation is I say hello.
- D. Greeting is Hello and salutation is Hello, Hello.
Answer: D
NEW QUESTION # 113
Given the code below:
const delay = async delay =>{
return new Promise((resolve,reject)=>{
console.log(1);
setTimeout(resolve,deleay);
});
};
const callDelay = async ()=>{
console.log(2);
const yup = await delay(1000);
console.log(3);
}
console.log(4);
callDelay();
console.log(5);
What is logged to the console?
- A. 4 2 1 5 3
Answer: A
NEW QUESTION # 114
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 # 115
The developer wants to test the array shown:
Const arr = Array (5) . fill (0);
Which two test are the most accurate for this array? Choose 2 answers
- A. Arr. forEach (elem => console .assert (elem === 0) );
- B. Console,assert(arr.length === 5) ;
- C. Console,assert(arr(0) === 0 $$ arr (arr .longth ) === 0) ;
- D. Console. Assert (arr. Length > 0) ;
Answer: A
NEW QUESTION # 116
Refer to the code below:
Const searchTest = 'Yay! Salesforce is amazing!" ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?
- A. > 5 >undefined
- B. > true > false
- C. > 5 > 0
- D. > 5 > -1
Answer: A
Explanation:
NEW QUESTION # 117
Refer to the following code:
What is the output of line 11?
- A. ["foo:1", "bar:2"]
- B. ["bar", "foo"]
- C. [1,2]
- D. ["foo", "bar"]
Answer: D
NEW QUESTION # 118
Given the JavaScript below:
Which code should replace the placeholder comment on line 05 to highlight accounts that match the search string'
- A. 'yellow : 'none'
- B. 'yellow' : null
- C. null : 'yellow'
- D. 'none1 : "yellow'
Answer: A
NEW QUESTION # 119
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/PrincePrettyPrint. Js';
Based on the code, what must be true about the printPrice function of the PricePrettyPrint modules for this import to work?
- A. printPrice must be an all export
- B. printPrice must be named export
- C. printPrice must be a multi export
- D. printPrice must be an default export
Answer: B
NEW QUESTION # 120
Refer to code below:
Let first = 'who';
Let second = 'what';
Try{
Try{
Throw new error('Sad trombone');
}catch (err){
First ='Why';
}finally {
Second ='when';
} catch (err) {
Second ='Where';
}
What are the values for first and second once the code executes ?
- A. First is Who and second is When
- B. First is why and second is when
- C. First is why and second is where
- D. First is who and second is where
Answer: B
NEW QUESTION # 121
Refer to the following code:
function test (val) {
If (val === undefined) {
return 'Undefined values!' ;
}
if (val === null) {
return 'Null value! ';
}
return val;
}
Let x;
test(x);
What is returned by the function call on line 13?
- A. Line 13 throws an error.
- B. 'Null value!'
- C. Undefined
- D. 'Undefined values!'
Answer: D
NEW QUESTION # 122
Refer to the code below:
Const searchTest = 'Yay! Salesforce is amazing!" ;
Let result1 = searchText.search(/sales/i);
Let result 21 = searchText.search(/sales/i);
console.log(result1);
console.log(result2);
After running this code, which result is displayed on the console?
- A. > 5 >undefined
- B. > true > false
- C. > 5 > 0
- D. > 5 > -1
Answer: A
Explanation:
NEW QUESTION # 123
Which three statements are true about promises?
The executor of a new promise runs automatically.
- A. A fulfilled or rejected promise will not change states.
- B. A promise has a . then 90 method.
- C. A pending promise can become fulfilled, settled or rejected.
- D. A settled promises can become resolved.
Answer: A,B,D
NEW QUESTION # 124
......
Latest Salesforce JavaScript-Developer-I Real Exam Dumps PDF: https://www.vceprep.com/JavaScript-Developer-I-latest-vce-prep.html
JavaScript-Developer-I Exam Dumps, JavaScript-Developer-I Practice Test Questions: https://drive.google.com/open?id=1Aj-g9AvGO49UMc8qPu7RfoeT99C0hsug