From 60d5a2d5188fd6de2f26c02c78ec431aaad46df9 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Sun, 18 Jun 2023 14:15:35 +0000 Subject: [PATCH 1/2] Setting up GitHub Classroom Feedback From 940343772d921f953094763f042694cb8a325b57 Mon Sep 17 00:00:00 2001 From: Anthony Chavis Date: Sun, 18 Jun 2023 10:27:56 -0400 Subject: [PATCH 2/2] Update leap-year.js --- leap-year.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/leap-year.js b/leap-year.js index 11900d2..9da8d75 100644 --- a/leap-year.js +++ b/leap-year.js @@ -1,14 +1,9 @@ -isLeapYear(){ - - // Write code here - -} - - +// Write code here +const isLeapYear = year => year % 400 == 0 ? true : year % 100 == 0 ? false : year % 4 == 0 ? true : false; // DONT CHANGE. THIS IS FOR TESTING -let years = [ 2015, 1970, 1996, 1960, 2100, 1900, 2000, 2400, 1800] +let years = [2015, 1970, 1996, 1960, 2100, 1900, 2000, 2400, 1800]; for (let year of years) { - console.log(isLeapYear(year) + console.log(isLeapYear(year)); }