Errata

JavaScript Cookbook

Errata for JavaScript Cookbook

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.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

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

Version Location Description Submitted by Date submitted
ePub Page 1
Part 1 > Chapter 3. Functions: The JavaScript Building Block > 1. recipe (Hoisting & Function placement)

"If you don't assign a value to the variable when you declare it, you'll still get an undefined when you access the variable:

console.log(a)
var a = 1;
"

In the context of the example I think it should be "If you assign a value ...".

HR  May 25, 2019 
Printed Page 10
Second block of code

Code example which includes "unknownVariable.length() > 0" does not match code at bottom of page 11 where it is explained. Code at bottom of page 11 appears to be cut off as it ends in "&&".

David Wallace Croft  Dec 11, 2015 
Printed Page 66
Line 19

Recursion in factorial function breaks. Factorial != factorial since JavaScript is case-sensitive.

Current code:

function factorial(n) {
return n== 1 ? 1 : n * Factorial(n -1);
}


Proposed code fix:

function factorial(n) {
return n== 1 ? 1 : n * factorial(n -1);
}

Andrew  May 16, 2018 
Printed Page 300
2nd sentence in Solution part of section 11.10

Text is 'One is to use nginx, as a reserve proxy'... It is very likely that 'reserve' should be 'reverse', as 'reverse' is used subsequently in this section.

George Byrkit  Jun 08, 2016 
PDF Page 414
first code snippet

Instead of

form ng-submit="doneEditing(todo)">

it should be

<form ng-submit="doneEditing(todo)">

Christos Monogios  Mar 08, 2016 
Printed Page 464
15.6 section title

'Unloading' should be 'Uploading' in the section title for 15.6

George Byrkit  Jun 08, 2016