JavaScript · Senior · Question 46 of 75

What does [1, 2, 3, 4].findLast(n => n % 2 === 1) return?

Explanation

findLast and findLastIndex (ES2023) search from the end of the array - without reverse, which mutates the array. For multiple matches, use filter.

Further reading

Problem with a question

JavaScript · Senior · question 46

Test yourself

Take the JavaScript · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz