In comp.lang.javascript message <
[email protected]
glegroups.com>, Thu, 2 Aug 2007 07:12:56, (e-mail address removed) posted:
A freely-available online book about JavaScript has just been
launched:
http://eloquentjavascript.net
Chap. 4.
The wording "milliseconds it is away from January 1st 1970" really means
a count starting with 0 at the very beginning of January 2nd. Commonly
one sees problems with "between" and "from". Actually, as the standards
say, the zero of the count is at the beginning of 1970-01-01 00:00:00
UTC. The UTC is important, though GMT might be more accurate as
javascript has no Leap Seconds.
You say "In addition to a date and time, Date objects also contain
information about a timezone." That is wrong. The only data in a Date
Object is an IEEE Double representing the milliseconds. A Date Object
also has a method getTimezoneOffset, but that makes an O.S. call giving
the aforesaid Double and returning the difference between local time and
UTC for that particular UTC. If it were stored in the Object, there
should be a setTimezoneOffset.
When it is one o'clock in Amsterdam it is ALWAYS either noon or midnight
in London - exactly in practice, but NL legal time is probably UTC-based
whereas UK legal time is probably still GMT-based. The time in NY will
generally be 7:00 but sometimes 8:00.
"Some functions can take any number of arguments" - I rather think any
function can take any number of arguments. There, "can use any" would
be better.
"inside Math. All the trigonometric functions are there" - not all, only
those JS knows. Omit the word "All".
In unpolluted proper British English, "cannot" implies impossible but
"can not" implies not compulsory. You cannot feed your cat tinned cat-
food (cats cannot open tins); you can not feed your cat anything but it
will get annoyed and go elsewhere.
Chap 10 : a list of the standard methods that accept RegExp arguments
could be useful. I know of six. There's a missing full stop.
In Appendix 2, "Next Chapter" is not a link. Because you have
overridden default text and link styles, I cannot tell that by looking
at it. I prefer default decoration; your colours are too close.