What\'s the correct way to merge two arrays in Javascript?
I\'ve got two arrays (for example):
var a1 = [{ id : 1, name : \"test\"}, { id : 2, name :
function mergeDiffs(Schedulearray1, Schedulearray2) { var secondArrayIDs = Schedulearray2.map(x=> x.scheduleid); return Schedulearray1.filter(x=> !secondArrayIDs.includes(x.scheduleid)).concat(Schedulearray2); }