Javascript Object merge()

Description

Javascript Object merge()


Object.merge = function () {
    return [].reduce.call( arguments, function ( ret, merger ) {
        Object.keys( merger ).forEach(function ( key ) {
            ret[ key ] = merger[ key ];/* ww  w .ja v a2 s .c o m*/
        });
        return ret;
    }, {} );
};



PreviousNext

Related