DEV Community

Cover image for JavaScript Program to Check Leap Year Using Conditional Operator
ali-dev-hash
ali-dev-hash

Posted on

2 1

JavaScript Program to Check Leap Year Using Conditional Operator

JavaScript Program to Check Leap Year Using Conditional Operator

must support == > https://codepen.io/Bilal1909/pen/dyNzzMz

Top comments (1)

Collapse
 
grahamthedev profile image
GrahamTheDev

I mean it doesn't actually work 😋

1600 - leap year
1700 - not a leap year
1800 - not a leap year
1900 - not a leap year
2000 - leap year.

If the year is divisible by 100 it is not a leap year.

Unless it is divisible by 400, in which case it is a leap year.

A fun one for you to fix, not that it will matter for another 79 years!

AWS Security LIVE! Stream

Go beyond the firewall

Security starts with people. Discover solutions to real-world challenges from AWS and AWS Partners on AWS Security LIVE!

Learn More

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay