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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -