Trying to learn by coding (React), my question: React uses map() everywhere, so can we replace every loop for example for loop with map ? When is good to use map and when for loop ? in following example i have used for loop, should i be using map ?
how would this be changed to map ?:
const links = currentLinks;
for (let i = 0; i < links.length; ++i) {
let border = links[i].boundary.points;
drawPath(canvas, ctx, border, '#AA1111', '#AA1111', 0.2);
}
-----------------
links.map(() => (
?
));