return now.getDay()==5 && now.getDate==13;
Janis Papanagnou <janis_papanagnou@hotmail.com> writes:
return now.getDay()==5 && now.getDate==13;
There is a pair of parentheses missing above.
Today I was surprised that some old code did not work as I'd have
expected:
function friday_13th (now)
{
return now.getDay()==5 && now.getDate==13;
}
That function returned 'false' and also putting parenthesis around
the (sub-) expressions did not help. I had to use a local variable
to make that work:
function friday_13th (now)
{
var f13 = now.getDay()==5 && now.getDate()==13;
return f13;
}
Can anyone explain that please?
Janis
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 250 |
Nodes: | 16 (2 / 14) |
Uptime: | 90:09:49 |
Calls: | 5,510 |
Calls today: | 5 |
Files: | 11,668 |
Messages: | 5,087,301 |