I have an array and var that look like this:
var paymentMilestones = [0, 30, 60, 90];
var daysOverdue = 33;
In JavaScript, how can I programmatically determine which of the paymentMilestones
indexes the daysOverdue
var is closest to? I need that value returned, so in this case the function should return 30
.