[Nov 27, 2024] Get to the Top with JavaScript-Developer-I Practice Exam Questions
Use Real JavaScript-Developer-I Dumps Free Sample Questions and Practice Test Engine
Salesforce JavaScript-Developer-I certification is a valuable credential for developers who want to demonstrate their expertise in building custom solutions on the Salesforce platform using JavaScript. With proper preparation and study, candidates can successfully earn this certification and advance their careers in the Salesforce ecosystem.
Salesforce JavaScript-Developer-I Certification Exam covers a wide range of topics, including JavaScript programming concepts, web development fundamentals, and the Salesforce Lightning platform. Developers who pass JavaScript-Developer-I exam will have a deep understanding of the Salesforce platform and will be able to build custom applications using JavaScript that integrate seamlessly with the Salesforce ecosystem.
NEW QUESTION # 91
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 the developer implement the request?
- A. Let arr1 = arr.mapBy (( num) => ( return num *2 )) .filterBy (( val ) => return val > 15 )) ;
- B. Let arr1 = arr.filter(( val) => ( return val > 15 )) .map (( num) => ( return num *2 ))
- 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 # 92
A developer needs to test this functions:
Which two assert statements are valid tests for this function?
- A. Console.assert(sum3 ([-3, 2]) -1) ;
- B. Console.assert(sum3((1, '2' ]) 12 );
- C. Console.assert(sum3 (['hello' 2, 3, 4]) NaN);
- D. Console.assert(sum3([0]) 0) ;
Answer: A,B
NEW QUESTION # 93
Refer to the code snippet below:
Let array = [1, 2, 3, 4, 4, 5, 4, 4];
For (let i =0; i < array.length; i++)
if (array[i] === 4) {
array.splice(i, 1);
}
}
What is the value of array after the code executes?
- A. [1, 2, 3, 5]
- B. [1, 2, 3, 4, 5, 4]
- C. [1, 2, 3, 4, 5, 4, 4]
- D. [1, 2, 3, 4, 4, 5, 4]
Answer: D
Explanation:
NEW QUESTION # 94
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, UC decides to implement a debounce function on string change
handler.
What are three key steps to implement this debounce function?
Choose 3 answers:
- A. Ensure that the network request has the property debounce set to true.
- B. Store the timeId of the setTimeout last enqueued by the search string change handle.
- C. If there is an existing setTimeout and the search string change, allow the existing
setTimeout to finish, and do not enqueue a new setTimeout. - 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. When the search string changes, enqueue the request within a setTimeout.
Answer: A,C,E
NEW QUESTION # 95
Which three options show valid methods for creating a fat arrow function? Choose 3 answers
- A. { } => { console.log (executed') ; )
- B. X, y, z => ( console.log ('executed') ; )
- C. X => {console.log {'executed'} ; }
- D. ( ) => { console.log (' executed') ; )
- E. (x, y, z) => (console.log ('executed') ;)
Answer: C,D,E
NEW QUESTION # 96
Given two expressions var1 and var2. What are two valid ways to return the logical AND of the two expressions and ensure it is data type Boolean ?
Choose 2 answers:
- A. Boolean(var1 && var2)
- B. Boolean(var1) && Boolean(var2)
- C. var1 && var2
- D. var1.toBoolean() && var2toBoolean()
Answer: A,B
NEW QUESTION # 97
Universal Containers recently launched its new landing page to host a crowd-funding campaign. The page uses an external library to display some third-party ads. Once the page is fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the one in the code below:
All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
- A. Use the DOM inspector to remove all the elements containing the class ad-library-item.
- B. Use the DOM inspector to prevent the load event to be fired.
- C. Use the browser console to execute a script that prevents the load event to be fired.
- D. Use the browser to execute a script that removes all the element containing the class ad-library-item.
Answer: A
NEW QUESTION # 98
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.
* Empty string 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(Infinity);
console.assert ( res === ' ' ) - B. let res = fizzbuzz(3);
console.assert ( res === ' buzz ' ) - C. let res = fizzbuzz(5);
console.assert ( res === ' ' ); - D. let res = fizzbuzz(15);
console.assert ( res === ' fizzbuzz ' )
Answer: A,B,D
NEW QUESTION # 99
A Developer wrote the following code to test a sum3 function that takes in an array of
numbers and returns the sum of the first three number in the array, The test passes:
Let res = sum2([1, 2, 3 ]) ;
console.assert(res === 6 );
Res = sum3([ 1, 2, 3, 4]);
console.assert(res=== 6);
A different developer made changes to the behavior of sum3 to instead sum all of the numbers
present in the array. The test passes:
Which two results occur when running the test on the updated sum3 function ?
Choose 2 answers
- A. The line 05 assertion passes.
- B. The line 02 assertion passes.
- C. The line 02 assertion fails
- D. The line 05 assertion fails.
Answer: B,D
NEW QUESTION # 100
A developer wrote the following code to test a sum3 function that takes in an array of numbers and returns the sum of the first three numbers in the array, and the test passes.
A different developer made changes to the behavior of sum3 to instead sum only the first two numbers present in the array.
Which two results occur when running this test on the updated sum3 function?
Choose 2 answers
- A. The line 05 assertion passes.
- B. The line 02 assertion passes.
- C. The line 05 assertion fails.
- D. The line 02 assertion fails.
Answer: B,C
NEW QUESTION # 101
Given the following code:
What is the logged by the first four log statements?
- A. 0 1 2 2
- B. 0 0 1 2
- C. 0 1 2 3
- D. 0 1 1 2
Answer: D
NEW QUESTION # 102
Refer to the code below:
<html lang="en">
<tableonclick="console.log(Table log');">
<tr id="row1">
<td>Click me!</td>
</tr>
<table>
<script>
functionprintMessage(event) {
console.log('Row log');
}
Let elem = document.getElementById('row1');
elem.addEventListener('click', printMessage, false);
</script>
</html>
Which code change should be made for the console to log only Row log when 'Click me! ' is clicked?
- A. Addevent.removeEventListener(); to window.onLoad event handler.
- B. Add.event.stopPropagation(); to window.onLoad event handler.
- C. Add event.stopPropagation(); to printMessage function.
- D. Add event.removeEventListener(); toprintMessage function.
Answer: C
NEW QUESTION # 103
Refer to the string below:
const str = 'Salesforce';
Which two statements result in the word 'Sales'?
Choose 2 answers
- A. str.substring (1, 5);
- B. str.substr (0, 5);
- C. str.substr(1, 5);
- D. str.substring (0, 5);
Answer: B,D
NEW QUESTION # 104
Refer to the code snippet:
Function getAvailabilityMessage(item) {
If (getAvailability(item)){
Var msg ="Username available";
}
Return msg;
}
A developer writes this code to return a message to user attempting to register a new username. If the username is available, variable.
What is the return value of msg hen getAvailabilityMessage ("newUserName" ) is executed and getAvailability("newUserName") returns false?
- A. "Msg is not defined"
- B. "newUserName"
- C. undefined
- D. "Username available"
Answer: C
NEW QUESTION # 105
A developer is trying to handle an error within a function.
Which code segment shows the correct approach to handle an error without propagating it elsewhere?
- A.

- B.

- C.

- D.

Answer: A
NEW QUESTION # 106
Universal Containers recently launched its new landing page to host a crowd-funding campaign. The page uses an external library to display some third-party ads. Once the page is fully loaded, it creates more than 50 new HTML items placed randomly inside the DOM, like the one in the code below:
All the elements includes the same ad-library-item class, They are hidden by default, and they are randomly displayed while the user navigates through the page.
- A. Use the DOM inspector to remove all the elements containing the class ad-library-item.
- B. Use the DOM inspector to prevent the load event to be fired.
- C. Use the browser console to execute a script that prevents the load event to be fired.
- D. Use the browser to execute a script that removes all the element containing the class ad-library-item.
Answer: D
NEW QUESTION # 107
Refer to the code below:
Let inArray =[ [ 1, 2 ] , [ 3, 4, 5 ] ];
Which two statements result in the array [1, 2, 3, 4, 5] ?
Choose 2 answers
- A. [ ]. concat ( [ ....inArray ]);
- B. []. Concat (... inArray);
- C. [ ]. Concat.apply ([ ], inArray);
- D. [ ]. concat.apply(inArray, [ ]);
Answer: B,C
NEW QUESTION # 108
A developer writers the code below to calculate the factorial of a given number.
Function factorial(number) {
Return number + factorial(number -1);
}
factorial(3);
What is the result of executing line 04?
- A. 0
- B. RuntimeError
- C. -Infinity
- D. 1
Answer: B
NEW QUESTION # 109
Refer to the following code:
<html lang="en">
<body>
<divonclick = "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. Inner messageOuter message
- B. Inner message
- C. Outer message
- D. Outer messageInner message
Answer: B
NEW QUESTION # 110
Which statement accurately describes an aspect of promises?
- A. .then ( ) manipulates and returns the original promise.
- B. .Them ( ) cannot be added after a catch.
- C. Agruments for the callback function passed to .then ( ) are optional.
- D. In a , them ( ) function, returning results is not necessary since callback will catch the result of a previous promise.
Answer: C
NEW QUESTION # 111
At Universal Containers, every team has its own way of copying JavaScript objects. The code Snippet shows an implementation from one team:
Function Person() {
this.firstName = "John";
this.lastName = 'Doe';
This.name =() => (
console.log('Hello $(this.firstName) $(this.firstName)');
)}
Const john = new Person ();
Const dan = JSON.parse(JSON.stringify(john));
dan.firstName ='Dan';
dan.name();
What is the Output of the code execution?
- A. Hello John DOe
- B. Hello Dan Doe
- C. TypeError: dan.name is not a function
- D. TypeError: Assignment to constant variable.
Answer: C
NEW QUESTION # 112
......
Pass Salesforce JavaScript-Developer-I exam - questions - convert Tets Engine to PDF: https://www.dumpsfree.com/JavaScript-Developer-I-valid-exam.html
2024 Realistic Verified Free Salesforce JavaScript-Developer-I Exam Questions: https://drive.google.com/open?id=1Xsu3gcK4tEGMZ5ZKvhTC9ROo4palZhkj