repl.txt (892B)
1 2 {{alias}}( value ) 3 Tests whether a value corresponds to a leap year in the Gregorian calendar. 4 5 A leap year is defined as any year which is exactly divisible by 4, except 6 for years which are exactly divisible by 100 and not by 400. In this 7 definition, 100 corresponds to years marking a new century, and 400 8 corresponds to the length of the *leap cycle*. 9 10 If not provided any arguments, the function returns a boolean indicating 11 if the current year (according to local time) is a leap year. 12 13 Parameters 14 ---------- 15 value: any 16 Value to test. 17 18 Returns 19 ------- 20 bool: boolean 21 Boolean indicating whether value corresponds to a leap year. 22 23 Examples 24 -------- 25 > var bool = {{alias}}( new Date() ) 26 <boolean> 27 > bool = {{alias}}( 1996 ) 28 true 29 > bool = {{alias}}( 2001 ) 30 false 31 32 See Also 33 -------- 34