重写lodash

1:thunk

 2:compact

 

 3:concat

4:difference

 5:differenceWith

 6:omit 

 7:pick

 

 8:drop

9:dropRight
 

 10 deepMerge

/**
 * 深度合并对象
 *
 * @param {Object} target 目标对象
 * @param {Object} source 源对象
 * @returns {Object} 目标对象
 */
export const deepMerge =(target, source)=> {
    Object.keys(source).forEach(key => {
        target[key] = target[key] && typeof target[key] === 'object' ? deepMerge(target[key], source[key]) : source[key]
    })
    return target
}

原文地址:https://www.cnblogs.com/binglove/p/12018231.html