modEach()

Takes an array or an object and traverses all of its key/value pairs allowing for modifications while in the end returning a reference to that same array or object.

This function is valid in v2.8.0 to v2.14.0. This function has been downloaded 42 times.

Parameters

{Array|Object} obj
Array or object that will be traversed.
{Function} fn
Function that can make changes for each value within obj. For each value within obj this function will be called with (1) the value, (2) the key and (3) a reference to obj.
{boolean=} opt_mapReturns Optional, Default:false
Indicates whether or no the return value from fn should be assigned to that corresponding key for obj.

Returns

{Array|Object}
A reference to obj.

Required Function

This function requires the following function which is included automatically:

  • forOf()
    Traverses all the characters in a string or all of the items in an array or an object, executing a function on each one.