date - Check if year is leap year in javascript -
function leapyear(year){ var result; year = parseint(document.getelementbyid("isyear").value); if (years/400){ result = true } else if(years/100){ result = false } else if(years/4){ result= true } else{ result= false } return result }
this have far (the entry on stored in "isyear"), followed here, using have, how can check if entry leap year based on these conditions(note may have done wrong when implementing pseudocode, please correct me if have) edit: note needs use integer not date function
function leapyear(year) { return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); }
Comments
Post a Comment