How to compare two arrays and if there is no element, then add to it from another?
Example:
arr [1,2,3,4,5]
tempDates [6,7,8]
If tempDates[i] !== arr[j] add to get
tempDates [1,2,3,4,5,6,7,8]
for (var i = 0; i < tempDates.length; i++) { for (var j = 0; j < arr.length; j++) { if(tempDates.length == arr.length) { return true; } else if (tempDates.length !== arr.length) { if(tempDates[i] !== arr[j]){ tempDates.push(j); } } } }