You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .

I’ve tried to reproduce these examples, but alas - arrMatches length property always gave me 0. At last (after several hours :)) I’ve found an explanation: exec() method returns an array but only first element contains current match, elements with indexes from 1 to n contain stored backreferences (if any).http://developer-test.mozilla.org/en...ts:RegExp:exec
So the following paragraphs on page 195 are not correct regarding exec() and match() functional similarity

Quote:

quote:The String object has a method called match(), which intentionally mirrors the functionality of the

Quote:

RegExp object’s exec() method. The main difference is that the method is called on the String object
and the RegExp object is passed in as an argument:

quote:Up until this point, the features discussed have all been part of DOM Level 1. This section introduces
some of the features of DOM Level 2, specifically objects in the DOM Level 2 Traversal and Range specification
relating to traversing a DOM document. These features are only available in Mozilla and
Konqueror/Safari.

I can't give it a try on Safari but current version of Mozilla (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511) gave me

1) About shifting, I think that there is an error when in the book we find "... The left shift fills these bits with the value in the 32nd bit..."(page 41- Left shift). Left shift operation inserts always 0 bits on the right side of 32bits signed integer, but preserves bit 31 (sign bit) from shifting.

2)

Quote:

quote:
For instance, -64 >> 5 >>> 1 does return 2147483616.

Does -64>>>1 return 2147483616 ?
Isn't it?

3) Page 39

Quote:

quote:3. The one's complement is converted back to a floating-point number.

Yes, NodeIterator was never fully implemented in Mozilla (doh!). It was allegedly supposed to be done but never was. I'll have to update that.

Paolo:

Yes, the description of shifting is pretty messed up, as Alexei pointed out earlier. And you're right, -64 >>> 1 does return 2147483616 (this is why answering forum posts at work is never a good idea).

And you're right, 32-bit number is better than floating-point number. Good catch.

Nicholas:
Once again I am not perfectly sure, but...
Page 312, last paragraph

Quote:

quote:Microsoft offers a currentStyle object on each element that includes all properties from the element

Quote:

background-color object as well the properties from any relevant CSS rule’s style object. The
currentStyle object works in the exact same way as the style object, with all the same properties
and methods. This means that even if a background color is defined in a CSS rule, currentStyle.
backgroundColor still contains the correct value:

I guess just element's style object was implied.

As for your new book, I can't wait too, but I'm afraid that it will be irreproachable and my help won't be needed :).