It is impossible to pass Salesforce JavaScript-Developer-I exam without any help in the short term. Come to Actualtests soon and find the most advanced, correct and guaranteed Salesforce JavaScript-Developer-I practice questions. You will get a surprising result by our Regenerate Salesforce Certified JavaScript Developer I practice guides.
Online Salesforce JavaScript-Developer-I free dumps demo Below:
NEW QUESTION 1
developer wants to use a module nameduniversalContainersLib and them call functions from it.
How should a developer import every function from the module and then call the fuctions foo and bar ?
- A. import * ad lib from ‘/path/universalContainersLib.js’; lib.foo();lib.bar();
- B. import (foo, bar) from ‘/path/universalContainersLib.js’; foo();bar();
- C. import all from ‘/path/universalContaineraLib.js’; universalContainersLib.foo(); universalContainersLib.bar();
- D. import * from ‘/path/universalContaineraLib.js’; universalContainersLib.foo(); universalContainersLib.bar();
Answer: A
NEW QUESTION 2
Why would a developer specify a package.jason as a developed forge instead of a dependency ?
- A. It is required by the application in production.
- B. It is only needed for local development and testing.
- C. Other requiredpackages depend on it for development.
- D. It should be bundled when the package is published.
Answer: B
NEW QUESTION 3
Refer to the code below:
for(let number =2 ; number <= 5 ; number += 1 ) {
// insert code statement here
}
Thedeveloper 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. assert (number % 2 === 0);
- B. console.error(number % 2 === 0);
- C. console.debug(number % 2 === 0);
- D. console.assert(number % 2 === 0);
Answer: B
NEW QUESTION 4
Refer to HTML below:
<div id =”main”>
<div id = “ card-00”>This card is smaller.</div>
<div id = “card-01”>The width and height of this card is determined by its contents.</div>
</div>
Which expression outputs the screen width of the element with the ID card-01?
- A. document.getElementById(‘ card-01 ’).getBoundingClientRest().width
- B. document.getElementById(‘ card-01 ’).style.width
- C. document.getElementById(‘ card-01 ’).width
- D. document.getElementById(‘ card-01 ’).innerHTML.lenght*e
Answer: A
NEW QUESTION 5
Given the following code: document.body.addEventListener(‘ click ’, (event) => { if (/* CODE REPLACEMENT HERE */) {
console.log(‘button clicked!’);
)
});
Which replacement for the conditional statement on line 02 allows a developer to correctly determine that a button on page is clicked?
- A. Event.clicked
- B. e.nodeTarget ==this
- C. event.target.nodeName == ‘BUTTON’
- D. button.addEventListener(‘click’)
Answer: C
NEW QUESTION 6
A developer creates a class that represents a blog post based on the requirement that a Post should have a body author and view count.
The Code shown Below: ClassPost {
// Insert code here This.body =body This.author = author;
this.viewCount = viewCount;
}
}
Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instanceof a Post with the three attributes correctly populated?
- A. super (body, author, viewCount) {
- B. Function Post (body, author, viewCount) {
- C. constructor (body, author, viewCount) {
- D. constructor() {
Answer: C
NEW QUESTION 7
Which function should a developer use to repeatedly execute code at a fixed interval ?
- A. setIntervel
- B. setTimeout
- C. setPeriod
- D. setInteria
Answer: A
NEW QUESTION 8
A developer implements and calls the following code when an application state change occurs: Const onStateChange =innerPageState) => {
window.history.pushState(newPageState, ‘ ’, null);
}
If the back button is clicked after this method is executed, what can a developer expect?
- A. A navigate event is fired with a state property that details the previous application state.
- B. The page is navigated away from and the previous page in the browser’s history is loaded.
- C. The page reloads and all Javascript is reinitialized.
- D. A popstate event is fired with a state property that details the application’s last state.
Answer: B
NEW QUESTION 9
A developer is wondering whether to use, Promise.then or Promise.catch, especially when a Promise throws an error?
Which two promises are rejected? Which 2 are correct?
- A. Promise.reject(‘cool error here’).then(error => console.error(error));
- B. Promise.reject(‘cool error here’).catch(error => console.error(error));
- C. New Promise((resolve, reject) => (throw ‘cool error here’}).catch(error => console.error(error)) ;
- D. New Promise(() => (throw ‘cool error here’}).then(null, error => console.error(error)));
Answer: BC
NEW QUESTION 10
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 11
Which three statements are true about promises ? Choose 3 answers
- A. The executor of a new Promise runs automatically.
- B. A Promise has a .then() method.
- C. A fulfilled or rejected promise will not change states .
- D. A settled promise can become resolved.
- E. A pending promise canbecome fulfilled, settled, or rejected.
Answer: BCE
NEW QUESTION 12
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 executenpm 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_ENVIs 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: BCD
NEW QUESTION 13
Refer to the code:
Given the code above, which three properties are set pet1? Choose 3answers:
- A. Name
- B. canTalk
- C. Type
- D. Owner
- E. Size
Answer: BCE
NEW QUESTION 14
Refer to the code below:
Let car1 = new Promise((_ , reject) => setTimeout(reject, 2000, “car 1 crashed in” =>
Let car2 =new Promise(resolve => setTimeout(resolve, 1500, “car 2 completed”) Let car3 =new Promise(resolve => setTimeout(resolve, 3000, “car 3 completed”) Promise.race(( car1, car2, car3))
.t hen (value => (
Let result = ‘$(value) the race.’;)}
.catch(arr => {
console.log(“Race is cancelled.”, err);
});
What isthe value of result when Promise.race executes?
- A. Car 3 completes the race
- B. Car 2 completed the race.
- C. Car 1 crashed in the race.
- D. Race is cancelled.
Answer: B
NEW QUESTION 15
Given the code below:
What is logged to the console?
- A. 1 2 3
- B. 1 3 2
- C. 2 1 3
- D. 2 3 1
Answer: D
NEW QUESTION 16
......
https://www.downloadfreepdf.net/JavaScript-Developer-I-pdf-download.html (157 New Questions)
