Originally Posted by Logic Ali
During execution, filter won't give you access to the array it generates, but forEach lets you specify the object treated as this:
so does filter and map ...
Originally Posted by jmrker;
I was trying to add 1 to each element of the original array
And see that the new array had values all incremented by one.
I thought I could avoid a for...loop with a filter() command.
then simply use .map() instead of .filter(). if your array has a name, you can name it in arguments on the map() call so that it's called "this" within the function, or as arguments inside the function...
BROWSER STATS [% share]
(2013/10/31) IE7:0.5, IE8:8.6, IE9:5.3, IE10:12.3, FF:17.7, CH:41.8, SF:8.1, MOBILE:20.4