Skip to content

Instantly share code, notes, and snippets.

@ChillyBwoy
Created October 26, 2010 14:16
Show Gist options
  • Save ChillyBwoy/646974 to your computer and use it in GitHub Desktop.
Save ChillyBwoy/646974 to your computer and use it in GitHub Desktop.
Check for a leap year
Date.prototype.leap = function(){
var year = this.getFullYear();
return (!(year % 4) && (year % 100) || !(year % 400));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment