function days_difference(startDate, endDate) {
const oneDay = 24 * 60 * 60 * 1000; // hours * minutes * seconds * milliseconds
return Math.round((endDate - startDate) / oneDay);
}
const dt1 = new Date('6/13/2022')
const dt2 = new Date('6/17/2022')
console.log(days_difference(dt1, dt2));
/*
run:
4
*/