Javascript Quiz: How Well Do You Know map function #programming #javascript #coding #quiz

preview_player
Показать описание
Are you ready for another code challenge? Join me in this video as you test your coding knowledge with the simple quiz questions.

Don't forget to make your guess in the comments below.

-------------------------------------------------------------------------------------------

🔔Like and subscribe for more videos. 🔔

------------------------------------------------------------------------------------------

Answer: OPTION D:- 18

Explanation:
The map function multiplies each element of the num array by 2, resulting in a new array [2, 4, 6, 8, 10].

The filter function then filters out any elements that are not greater than 5, leaving [6, 8, 10].

Finally, the reduce function sums all the remaining elements, resulting in the output of 18.
Рекомендации по теме
Комментарии
Автор

shouldn't it be 24? we filtered out values less than 5 on the .filter()... Meaning, we're left with (3, 4, 5)*2 which would be (6, 8, 10)... .reduce() sums up the values resulting in 24...

cial
welcome to shbcf.ru