You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E.g. .day() returns a number ranged from 0 to 6, yet the return type is number. It should instead be 0 | 1 | 2 | 3 | 4 | 5 | 6. If this doesn't cause any real issues that I'm unaware of, it can be beneficial in some situations. For example:
constWEEKDAYS=['Sunday','Monday', ...,'Friday']asconst;WEEKDAYS[dayjs().day()];// Currently can be undefined.
With the more accurate return type there will be no need for a runtime check or an exclamation mark.
The text was updated successfully, but these errors were encountered:
E.g.
.day()
returns a number ranged from 0 to 6, yet the return type isnumber
. It should instead be0 | 1 | 2 | 3 | 4 | 5 | 6
. If this doesn't cause any real issues that I'm unaware of, it can be beneficial in some situations. For example:With the more accurate return type there will be no need for a runtime check or an exclamation mark.
The text was updated successfully, but these errors were encountered: