News for hackers. Stuff that matters.
Re:Ask HN: Why isn't there a `setDay` method on the Date pro... by CyberFonic on Monday September 19, 2016 @12:25AM (#12528898)
console.log(today.getDay()) // prints 1

assuming there was a setDay, and you invoke:

today.setDay(3)

should today now be: 21/9/2016 or 14/9/2016 or 19/10/2016 or 19/9/2040 or ... ?

I think you can see that unlike the other setters, setDay would not have an "obvious" implementation.

There are no comments on this comment yet.