Is it possible to determine if a date is a Saturday or Sunday using JavaScript?
Do you have the code for this?
I think this is an elegant way to do this:
function showDay(d) { return ["weekday", "weekend"][parseInt(d.getDay() / 6)]; } console.log(showDay(new Date()));