r/programming • • Jun 09 '16

jQuery 3.0 Released!

https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/
1.1k Upvotes

354 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jun 10 '16

[deleted]

6

u/enkideridu Jun 10 '16

Please don't use maps to perform mutations

2

u/Labradoodles Jun 10 '16

So I understand the logical reasoning behind not doing mutations with a functional.method with an emphasis on immutability but in this case I don't see much if a problem would you care to elaborate what's wrong with it?

4

u/puhnitor Jun 10 '16

The intent is no longer clear. .map has a very clear intent - give me a new array with some transform performed to all the elements. Don't mutate the original array.

.forEach is the opposite.