1
我想區分兩個對象,只獲取更新。Diffing兩個對象,只獲取更新
let alpha = {
brown: true,
green: true,
blue: true
}
let beta = {
green: false,
}
doSomething(alpha, beta) // => {green: false}
let alpha = {
brown: true,
green: true,
blue: true
}
let beta = {
green: true,
}
doSomething(alpha, beta) // => false
到目前爲止,這是我得到的。
let alphaSameKeys = pick(alpha, Object.keys(beta))
console.log(alpha) // => {green: true}
如何使用lodash完成此項工作?
我想看看https://github.com/benjamine/jsondiffpatch – Enkode