Web Technology
primer-original-v2easyJavaScriptArray MethodsmapforEachprimer-original-v2

What does Array.map() return that Array.forEach() does not?

Answer options

A
Nothing — they are the same
B
A new array with the results of calling the callback on each element
C
A boolean indicating success
D
The original array, modified in place

Correct answer: A new array with the results of calling the callback on each element

Detailed Solution & Conceptual Analysis

This question has been retained as-is due to its unique context.

Key Engineering Takeaway

In Web Technology, understanding the underlying mechanics of JavaScript is critical for writing performant, bug-free production code and passing rigorous technical architecture reviews.

Related Web Technology questions

Practice more Web Technology questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.