var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
_.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
// => [{ 'x': 2, 'y': 1 }]
const fileSizes = {
testFile1: 65,
testFile2: 48,
}
function getFileSize(filename, cb) {
setTimeout(() => cb(fileSizes[filename]), Math.random() * 500);
}
function sumFileSizes(filename1, filename2, cb) {
let s = 0
const ss = (sss) => s += sss
getFileSize(filename1, ss)
getFileSize(filename2, ss)
setTimeout(() => cb(s), 505)
}
sumFileSizes('testFile1', 'testFile2', (k) => console.log(k))