Add some javadoc to update
This commit is contained in:
parent
54137398ea
commit
f199cd335a
@ -39,6 +39,10 @@ function updateArray(updates, obj) {
|
|||||||
* Or with a function:
|
* Or with a function:
|
||||||
* update({ foo: x => (x + 1) }, { foo: 2 });
|
* update({ foo: x => (x + 1) }, { foo: 2 });
|
||||||
* // => { foo: 3 }
|
* // => { foo: 3 }
|
||||||
|
*
|
||||||
|
* @param {Object|Function} updates
|
||||||
|
* @param {Object|Array} object to update
|
||||||
|
* @return {Object|Array} new object with modifications
|
||||||
*/
|
*/
|
||||||
function update(updates, obj) {
|
function update(updates, obj) {
|
||||||
if (typeof updates === 'function') {
|
if (typeof updates === 'function') {
|
||||||
|
Loading…
Reference in New Issue
Block a user