math

Methods

(static) add(object, path, addend) → {Object}

Source:
Since:
  • 0.1.7
See:
Replaces by the addition of the former number and the given number.
Example
add({ nested: { prop: 2 } }, 'nested.prop', 4) // => { nested: { prop: 6 } }
Parameters:
Name Type Description
object Object The object to modify.
path Array | string The path of the property to set.
addend number The number to add.
Returns:
Returns the updated object.
Type
Object