Yes, someone actually did this and I found it running on our server
weekend = dayOfWeek > 5
Sunday is 1 0 and Saturday is 7 6. You just made Friday part of the weekend You forgot Sunday
I was off by one, but Sunday is 0 in javascript
Both Monday and Sunday are used as the first day of the week with quite some regularity. It’s a completely arbitrary standard no different to "the tenth month is the one called “October”. Or dividing a day into 24 segments which are each broken into 60 smaller segments of 60 even smaller segments. You can’t say either is “wrong” per se.
Personally, I was brought up learning Sunday is the first day of the week, but at some point decided that was bullshit partly because it’s the week end. But also just from a practical standpoint when looking at a calendar, it’s useful to have the weekend days grouped together.