Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas (Pacific Consulting Group) ThomasPCG

View GitHub Profile
@ThomasPCG
ThomasPCG / leapyears.js
Last active Jun 7, 2018
Checking and getting leap years in pure Node.js
View leapyears.js
//Check if parameter yr is a leap year.
var isLeapYear = function(yr) {
return (((yr % 4 === 0) && (yr % 100 !== 0)) || (yr % 400 === 0));
};
//Get leap year
// Paramaters:
// yr - starting year
// iteration - number of years to print out
// count - internal variable for tracking
View keybase.md

Keybase proof

I hereby claim:

  • I am thomaspcg on github.
  • I am thomaslim (https://keybase.io/thomaslim) on keybase.
  • I have a public key ASD4qKKft8SzxPkT93lnOSzr2jb1-ruZ3jJH_Dw6lL9L9Qo

To claim this, I am signing this object:

You can’t perform that action at this time.