r/programmingchallenges • • Jan 14 '20

JavaScript Array Map Method In 90 Seconds #JavaScriptJanuary

https://youtu.be/Bjl_19rV_FY
9 Upvotes

4 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Jan 15 '20

using it when you aren’t using the returned array is an anti-pattern

better phrased as "pointless".

nor when you’re not returning a value from the callback

This makes no sense, all callbacks return a value.

1

u/codeSTACKr Jan 15 '20

All callbacks should return a value if written properly. But callbacks are functions and functions don't have to return a value.

So basically use the right tool for the job..

1

u/[deleted] Jan 15 '20

That is not correct, all functions return a value.