Errata

JavaScript for PHP Developers

Errata for JavaScript for PHP Developers

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
PDF
Page 1
3rd paragraph

"It?s an API (Application Programming Interface)
that for working with structured documents such as XML, XHTML and
HTML."

This needs either a verb in the "that" clause, or "that" could just be deleted.

Randy Owens  Feb 12, 2013 
PDF
Page 2
2nd paragraph

"It?s a collection of properties and methods that deal with browser?s
specifics...."

That should either be "browsers'" (apostrophe after the 's'), or have an article before it, "a browser's" or "the browser's".

Randy Owens  Feb 12, 2013 
PDF
Page 3
1st paragraph

"...so you
can familiarize with it...."

Needs "yourself" in there.

Randy Owens  Feb 12, 2013 
PDF
Page 3
3rd paragraph

"It?s a very popular language, it is practically everywhere...."

Comma splice; use a semicolon or full stop there.

Randy Owens  Feb 12, 2013 
Printed, PDF
Page 4
2nd paragraph

((("environment"

should be removed

Adam Zaremba  Jun 03, 2013 
PDF
Page 4
8th paragraph

"You can make alias to it in /bin/jsc...."

"an alias", and I would change "in" to "at" to boot.

Randy Owens  Feb 12, 2013 
PDF
Page 12
3rd paragraph (after "null and undefined")

"You saw the first three of the first three of the five primitive types...."

Looks like "three of the" got duplicated.

Randy Owens  Feb 12, 2013 
PDF
Page 15
3rd paragraph (after "Strict comparison")

"Have you noticed ... used so far."

It's a question, so that should end with a question mark.

Randy Owens  Feb 12, 2013 
PDF
Page 15
3rd paragraph (after "Strict comparison")

"...that all code example..."

"examples", plural

Randy Owens  Feb 12, 2013 
PDF
Page 15
4th paragraph

"Three equal signs mean _strict comparison...."

There was probably supposed to be another underscore after "comparison", to make it italic, in parallel with the "loose comparison" in the following paragraph/bullet.

Randy Owens  Feb 12, 2013 
PDF
Page 16
2nd paragraph

"...they'll always be casted to true...."

This may differ for jargon use of "cast", but I've never seen a past or participle "casted"; it's always been uninflected.

Randy Owens  Feb 12, 2013 
PDF
Page 18
1st paragraph

"If you skip it will still work...."

Needs "it" twice there, maybe with a comma in between.

Randy Owens  Feb 12, 2013 
PDF
Page 18
1st paragraph

"The $...
is uncommon but absolutely valid part of a name."

Should have either "an uncommon" or "a valid", depending on whether "uncommon" is meant to be a predicate adjective, or adjective describing "part".

Randy Owens  Feb 12, 2013 
PDF
Page 19
JavaScript for-in example

In the for-in loop itself, "out += key + ': ' + clothes[key] . "\n";", that last period seems to be left over from the PHP version, and should be another plus sign.

Randy Owens  Feb 12, 2013 
PDF
Page 24
2nd line

"sum(3); // 3", but since the whole point was to make a default of 2 for the second addend, it should be a 5 in the comment part.

Randy Owens  Feb 12, 2013 
PDF
Page 30
example pseudo-code at bottom

In the interpreter's "comments" finding global_ten, "yey me!", I would really expect "yay".

Randy Owens  Feb 12, 2013 
PDF
Page 48
3rd paragraph

"You?ve already seen the use of object literals at several occasions in this book. For
example when talking about representing PHP?s associative arrays in JavaScript."

Sentence fragment. Change period to comma, and lc "For".

Randy Owens  Feb 14, 2013 
PDF
Page 49
3rd paragraph

"...the space around the dot in optional and the interpreter
think you're trying...."

s/in/is/, s/think/thinks/

Randy Owens  Feb 14, 2013 
PDF
Page 49
4th paragraph

"(strings
literals can be converted...."

s/strings/string/ or delete "literals"

Randy Owens  Feb 14, 2013 
PDF
Page 50
2nd paragraph

"show up if you don?t filtered them out...."

s/filtered/filter/

Randy Owens  Feb 14, 2013 
PDF
Page 51
7th (last) paragraph

"...for any of the two objects."

s/any/either/

Randy Owens  Feb 14, 2013 
PDF
Page 62
1st paragraph

"...in its 9
main constructor functions. Either as properties and methods...."

Another sentence fragment; again, replace period with comma, and lc "Either".

Randy Owens  Feb 14, 2013 
PDF
Page 64
note

"...when typeof in not enough."

s/in/is/

Randy Owens  Feb 14, 2013 
PDF
Page 65
1st paragraph

"...the method hasOwnProperty(), it lets you differentiate...."

Comma splice; replace the comma with a semicolon or period, and capitalize accordingly.

Randy Owens  Feb 14, 2013 
PDF
Page 70
7th paragraph

About splice(), it says "It removes elements
by given start and end index." But according to the JS Pocket Reference (and your own example), "[t]he second argument specifies the number of elements that should be deleted from... the array." Which is not how I'd interpret "end index", especially after slice() used it just the way I'd expect.

Randy Owens  Feb 14, 2013 
PDF
Page 71
2nd paragraph

"...the
last elements becomes the first and so on...."

Either "elements become" or, even better, "element becomes", but one 's' or another has to go.

Randy Owens  Feb 14, 2013 
PDF
Page 71
5th paragraph

"Let's consider regular expressions next"

missing period at the end of sentence & paragraph

Randy Owens  Feb 14, 2013 
PDF
Page 72
2nd section title

"exec() ======"

I think maybe you use three equal signs to indicate a header level, like in MediaWiki markup? And then somehow all six ended up following 'exec()', instead of three on each side. Otherwise, I don't know what's going on here.

Note from the Author or Editor:
yeah, mistake in formatting.

I'm using AsciiDoc and lovin' it :)

http://blog.stoyanstefanov.com/asciidoc/
http://www.jspatterns.com/unit-testing-in-asciidoc/

Randy Owens  Feb 14, 2013 
PDF
Page 72
4th paragraph

"Let's see an example is more detail."

s/is/in/

Randy Owens  Feb 14, 2013 
PDF
Page 75
2nd paragraph

Referring to slice(), substring(), and substr():
"These... take a start and end index as opposed to
start index and length as substr() does in PHP."

But JavaScript substr() takes a length, not an end index, just like the PHP one.

Randy Owens  Feb 14, 2013 
PDF, Mobi
Page 88
2nd paragraph

"Both methods are the same in you don?t...."

Should be "in that you don't".

Randy Owens  Feb 20, 2013 
PDF, Mobi
Page 89
3rd paragraph

"...equivalent of is_array() is PHP."

Should be "in PHP."

Randy Owens  Feb 20, 2013 
PDF, Mobi
Page 95
6th paragraph

"...or using it?s call method:"

It's "its", not "it's". I.e. use "its" here.

Randy Owens  Feb 21, 2013 
PDF
Page 96
8th (last) paragraph

"Attempt... will now be unsuccessful:"

Should probably be either "An attempt" or "Attempting".

Randy Owens  Feb 21, 2013 
PDF, Mobi
Page 98
1st paragraph

"Then this function return a new function...."

"returns", of course

Randy Owens  Feb 21, 2013 
PDF
Page 100
last example

"constant.define('hi', 'hoho')' // false"

There's an extra single quote after the right parenthesis. This also messes up the color on the following line, for media that display color. Also also, I think it should be replaced by a semicolon (they are right next to each other, aren't they?), although I'm still working on understanding just when it's needed, and when it isn't.

Randy Owens  Feb 21, 2013 
PDF
Page 101
4th paragraph

"...it
would be wise to implements them...."

"to implement"

Randy Owens  Feb 21, 2013 
PDF
Page 101
4th paragraph

"This chunks of code...."

Probably "These chunks", maybe "This chunk".

Randy Owens  Feb 21, 2013 
PDF, Mobi
Page 105
4th paragraph

"(say, on open source library)"

"an" instead of "on"

Randy Owens  Feb 21, 2013 
PDF, Mobi
Page 105
2nd bullet point

"? adding all you stuff there"

"your stuff"

Randy Owens  Feb 21, 2013 
PDF, Mobi
Page 106
3rd paragraph

"For a desert,..."

Definitely "dessert", and I would say "For dessert," without an article.

Randy Owens  Feb 21, 2013 
PDF, Mobi
Page 106
6th paragraph

"And we want to get the exact same object every
time we call a specific constructor, We?ll looking for something that behaves like this:"

* replace comma with period or question mark
* "We're looking" or "We'll be looking"
* might be better to recast this part altogether, with the preceding rhetorical question in mind

Randy Owens  Feb 21, 2013 
PDF
Page 108
1st paragraph

"...lets you to defer...."

"lets you defer" or maybe "allows you to defer"

Randy Owens  Feb 21, 2013 
PDF
Page 111
7th paragraph

"...its great manual (http://php.net) especially with
all the... comments."

Could use a comma after the parenthetical.

Randy Owens  Feb 21, 2013 
PDF
Page 112
1st paragraph

"...you?ll happy to learn...."

"you'll be happy"

Randy Owens  Feb 21, 2013 
PDF
Page 112
3rd paragraph

"...may not be able deduct the purpose...."

"able to deduce" (both missing 'to' and s/deduct/deduce/)

Randy Owens  Feb 21, 2013 
PDF
Page 112
3rd paragraph

"...so the it provides...."

Probably just remove 'the'. Alternatively, replace 'it' with an appropriate common noun.

Randy Owens  Feb 21, 2013 
PDF
Page 113
4th paragraph

"...some error are easily masked...." (oh, the irony!)

s/error/errors/

Randy Owens  Feb 21, 2013