Toggle menu

merge

Merges multiple objects into one.

This library is distributed under the MIT license, its source is https://www.npmjs.com/package/merge, where you'll also find full documentation.

Executed

Server-side only.

Example

function(params, credentials) {
    var merge = require('merge');
    var fruit = {
        'type': 'apple',
        'colour': 'green'
    };
    var cat = {
        'name': 'Cornelius',
        'age': 5
    };
    var result = merge(fruit, cat);
    return result;
}

Returns

{
    "jsonrpc": "2.0",
    "id": 469,
    "result": {
        "type": "apple",
        "colour": "green",
        "name": "Cornelius",
        "age": 5
    }
}

Last modified on 10 March 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon