const weekDaySorter = { 'Mon':1 , 'Tue':2 , 'Wed':3 , 'Thu':4 , 'Fri':5 , 'Sat':6 ,'Sun':7 , };
let weekDay = ['Sun', 'Wed', 'Mon'];
weekDay.sort(function sortByWeekDay(a, b){
console.log(i);
i++;
return weekDaySorter[a] - weekDaySorter[b];
});
console.log(weekDay);