Loop an Array in React
Freshers google ‘loop array in React’ because for/while feel natural. Inside JSX braces you need an expression. map is that expression. Outside JSX, a normal for is fine: build rows, then {rows} in the return.
forEach doesn’t return anything useful for JSX — it returns undefined. That’s why tutorials insist on map, not forEach.
Loop an Array in React — on screen: Asha, Kabir, Neha. for is fine in JS above return — not inside JSX braces as a statement.
map not forEach inside JSX.