Super simple example,
var beforeList = [{"name": "A"},{"name": "B"},{"name": "C"}]
var updateList = [{"name": "A"},{"name": "B"},{"name": "D"}]
I have to compare this two and if there is a missing data, i have to insert updatelist
data to before List.
So the result I want is,
function someLogicHere(beforeList, updateList){
// some logic here
return afterList(i.e [{"name": "A"},{"name": "B"},{"name": "C"},{"name": "D"}] in here)
}
Any good or awesome lib or plug-in is OK.
I made by myself with forEach
but it really is bad.