js-mentorship-razvan / javascript

Javascript study notes
GNU General Public License v3.0
22 stars 2 forks source link

Leap Years #574

Open RazvanBugoi opened 4 years ago

RazvanBugoi commented 4 years ago

https://www.codewars.com/kata/526c7363236867513f0005ca/train/javascript

RazvanBugoi commented 4 years ago
function isLeapYear(year) {
  if(year % 400 == 0) return true;
  if(year % 100 == 0 && year % 4 == 0) return false;
  if(year % 4 == 0) {return true} else {return false;}
}
RazvanBugoi commented 4 years ago

Refactoring cu mai putine if-uri.