ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 138 - Certified JavaScript Developer I discussion

Report
Export

Refer to the code below:

Const myFunction = arr => {

Return arr.reduce((result, current) =>{

Return result = current;

}, 10};

}

What is the output of this function when called with an empty array ?

A.
Returns 0
Answers
A.
Returns 0
B.
Throws an error
Answers
B.
Throws an error
C.
Returns 10
Answers
C.
Returns 10
D.
Returns NaN
Answers
D.
Returns NaN
Suggested answer: D
asked 23/09/2024
Verónica Crespo
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first