It is more faster and easier to pass the Salesforce JavaScript-Developer-I exam by using High quality Salesforce Salesforce Certified JavaScript Developer I questuins and answers. Immediate access to the Down to date JavaScript-Developer-I Exam and find the same core area JavaScript-Developer-I questions with professionally verified answers, then PASS your exam with a high score now.
Online JavaScript-Developer-I free questions and answers of New Version:
NEW QUESTION 1
A developer wrote a fizzbuzz function that when passed in a number, returns the following:
‘Fizz’ if the number is divisible by 3. ‘Buzz’ if the number is divisible by 5.
‘Fizzbuzz’ if the number is divisible by both 3 and 5. Emptystring if the number is divisible by neither 3 or 5.
Which two test cases will properly test scenarios for the fizzbuzz function? Choose 2 answers
- A. let res = fizzbuzz(5); console.assert ( res === ‘ ’ );
- B. let res = fizzbuzz(15);console.assert ( res ===‘ fizzbuzz ’ )
- C. let res = fizzbuzz(Infinity); console.assert ( res === ‘ ’ )
- D. let res = fizzbuzz(3); console.assert ( res === ‘ buzz ’ )
Answer: BCD
NEW QUESTION 2
A developer wants to use a try...catch statement to catch any error that countSheep () may throw and pass it to a handleError () function.
What is the correct implementation of the try...catch?
A)
B)
C)
D)
- A. Option
- B. Option
- C. Option
- D. Option
Answer: A
NEW QUESTION 3
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 4
A developer has the following array of student test grades: Let arr = [ 7, 8, 5, 8, 9 ];
The Teacher wants to double each score and then see an array of the students who scored more than 15 points.
How should thedeveloper implement the request?
- A. Let arr1 = arr.filter(( val) => ( return val > 15 )) .map (( num) => ( return num *2 ))
- B. Let arr1 = arr.mapBy (( num) => ( return num *2 )) .filterBy (( val ) => return val > 15 )) ;
- C. Let arr1 = arr.map((num) => num*2). Filter (( val) => val > 15);
- D. Let arr1 = arr.map((num) => ( num *2)).filterBy((val) => ( val >15 ));
Answer: C
NEW QUESTION 5
Teams at Universal Containers(UC) work on multiple JavaScript projects at the same time. UC is thinking about reusability and how each team can benefit from the work of others. Going open-source or public is not an option at this time.
Which option is available to UC with npm?
- A. Private packages can be scored, and scopes can be associated to a private registries.
- B. Private registries are not supported by npm, but packages can be installed via URL.
- C. Private packages are not supported, but they can use another package manager like yarn.
- D. Private registries are not supported by npm, but packages can be installed via git.
Answer: A
NEW QUESTION 6
Given HTML below:
Which statement adds the priority = account CSS class to the universal COntainers row ?
- A. Document.querySelector(‘#row-uc’).classes.push(‘priority-account’);
- B. Document .queryElementById(‘row-uc’).addclass(‘priority-account’);
- C. Document .querySelector(‘#row-uc’).classList.add(‘priority-account’);
- D. Document .querySelectorALL(‘#row-uc’).classList.add(‘priority-account’);
Answer: B
NEW QUESTION 7
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 8
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 9
Refer to the following code that imports a module named utils:
Which two implementations of Utils.js export foo and bar such that the code above runs without error?
Choose 2 answers
- A.

- B.

- C.

- D.

Answer: BC
NEW QUESTION 10
Refer to the code below:
What is the value of result when the code executes?
- A. 10-10
- B. 5-5
- C. 10-5
- D. 5-10
Answer: A
NEW QUESTION 11
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 12
developer uses the code below to format a date.
After executing, what is the value offormattedDate?
- A. May 10, 2020
- B. June 10, 2020
- C. October 05, 2020
- D. November 05, 2020
Answer: A
NEW QUESTION 13
A developer creates a generic function to log custom messages in the console. To do this, the function below is implemented.
Which three console logging methods allow the use of string substitution in line 02?
- A. Assert
- B. Log
- C. Message
- D. Info
- E. Error
Answer: AD
NEW QUESTION 14
Refer to the following code:
<html lang=”en”>
<body>
<div onclick = “console.log(‘Outer message’) ;”>
<button id =”myButton”>CLick me<button>
</div>
</body>
<script>
function displayMessage(ev) { ev.stopPropagation(); console.log(‘Inner message.’);
}
const elem =document.getElementById(‘myButton’); elem.addEventListener(‘click’ , displayMessage);
</script>
</html>
What will the console show when the button is clicked?
- A. Outer message
- B. Outer message Inner message
- C. Inner message Outer message
- D. Inner message
Answer: D
NEW QUESTION 15
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 16
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 17
Refer to following code block:
Let array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,];
Let output =0;
For (let num of array){ if (output >0){
Break;
}
if(num % 2 == 0){
Continue;
}
Output +=num;
What is the value of output after the code executes?
- A. 16
- B. 36
- C. 11
- D. 25
Answer: A
NEW QUESTION 18
......
https://www.allfreedumps.com/JavaScript-Developer-I-dumps.html (157 New Questions)