What I'm saying is that your function literally doesn't work correctly.
isLeapYear(2100); // true
That's incorrect.
Oh, sorry, you're right! I forget something. Try again with my changes.
In this case, why do you even need the ternary? true will always evaluate to true.
true
In other words, this:
true ? ((year % 400 === 0) || (year % 100 !== 0)) && ((year % 4) == 0) : false;
is the exact same thing as this:
((year % 400 === 0) || (year % 100 !== 0)) && ((year % 4) == 0);
Perfect!! I totally agree with you! 👏👏👏👏👏👏
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What I'm saying is that your function literally doesn't work correctly.
That's incorrect.
Oh, sorry, you're right! I forget something.
Try again with my changes.
In this case, why do you even need the ternary?
true
will always evaluate totrue
.In other words, this:
is the exact same thing as this:
Perfect!!
I totally agree with you! 👏👏👏👏👏👏