Day of the week: Difference between revisions

→‎{{header|CoffeeScript}}: made first example nicer, snipped second example
(→‎{{header|CoffeeScript}}: made first example nicer, snipped second example)
Line 432:
=={{header|CoffeeScript}}==
 
<lang coffeescript>for year in [2008...2121]
december = 11 # xmasgotta = newlove Date year, 11,APIs 25:)
sunday = 0
console.log "#{xmas.toDateString()} is a Sunday" if xmas.getDay() is 0</lang>
<lang coffeescript>for year in [2008...2121]
 
xmas = new Date year, december, 25
or in a more convoluted way:
console.log "#{xmas.toDateString()} is a Sunday"year if xmas.getDay() is 0</lang>sunday
 
<lang coffeescript>for year in [2008...2121]
if (xmas = new Date year, 11, 25).getDay() is 0 then console.log xmas.getFullYear()
</lang>
 
one-liner:
or yet:
 
<lang coffeescript>console.log year for year in [2008...2121] when new Date(year, 11, 25).getDay() is 0</lang>
 
<output>
2011
2016
2022
2033
2039
2044
2050
2061
2067
2072
2078
2089
2095
2101
2107
2112
2118
</output>
 
=={{header|ColdFusion}}==
Anonymous user