Errata for CoffeeScript
We try to keep our books accurate, but sometimes mistakes creep in. This page lists the errors submitted by our astute readers. If you've found a new error, please submit it.
The latest version of the book is P1.0, released almost 2 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| xvii |
#47355: parens aren't needed in the CoffeeScript line that assigns to cubedList--R. Mark Volkmann Trevor Burnham says: No, it does. I think your confusion is from running @cubedList = cube num for num in list@ on the REPL; since 1.1, if you put a loop expression on the REPL, you get the value of that loop (that is, a list comprehension). But if you check the value of @cubedList@ after running that line, you'll find that it's just a single number, because @cubedList = cube num for num in list@ parses as @(cubedList = cube num) for num in list@. |
P1.0
08-Aug-11 |
||
| 2 |
#48978: Current Node.js installer (v0.6.14) from Node.js home page installs both Node.js and npm natively on Windows and added to %PATH%, no Cygwin re...more...
|
P1.0
24-Mar-12 |
||
| 2 |
#47323: Standard cygwin doesn't include curl, which you need for the installation of nodejs
PS i hate cygwin. You're either on windows or not. There...more...
Trevor Burnham says: Yes, Cygwin is a pain. I feel for you. However, as the book notes, Node 0.6 is supposed to provide full native support for Windows—and it should be out in just a few months.
|
P1.0
30-Jul-11 |
||
| 7 |
#48356: "$ coffee -cwo js coffee"
This is useful and I wonder if its worth adding more about how to work effectively with coffee alongside node.js,...more...
|
P1.0
18-Dec-11 |
||
| 18 |
#49739: 2,2 Scope: Where you see 'em, first example
Book says:
age = 99
reincarnate = -> age = 0 reincarnate()
console.log "I am #{age} years...more...
|
P1.0
25-Aug-12 |
||
| 18 |
#49740: for previous report, forgot this: $ coffee -v
|
P1.0
25-Aug-12 |
||
| 18 |
#48606: With Node.js version v0.6.0 and CoffeScript version 1.2.0 , when this snippet is executed :
count = 0
incrementCount = -> count++
increm...more...
|
P1.0
28-Jan-12 |
||
| 20 |
#48662: In the last line of the purple box, sew should be sow. You sew clothes and sow seeds.--Chris Proctor |
P1.0
05-Feb-12 |
||
| 20 |
#47497: In the box "Shadowing: The Name's the Same",
|
P1.0
02-Sep-11 |
||
| 20 |
#49302: "lest you sew the seeds of scope confusion." should be "lest you sow the seeds of scope confusion."--Kirk Klobe |
P1.0
10-May-12 |
||
| 23 |
#49328: Book says:
setName 'Lulu'
console.log name # 'Lulu'
console.log @name # undefined
But when I run the code, I don't get "undefined" fo...more...
|
P1.0
14-May-12 |
||
| 27 |
#47500: On the last line of the page, "ellipse" should probably be "ellipsis".--Marc Paterno |
P1.0
03-Sep-11 |
||
| 29 |
#48232: "sew the seeds" s/b "sow the seeds"--Pete |
P1.0
08-Dec-11 |
||
| 42 |
#50199: Where slices are described, the following example is given:
coffee> ['this', 'that', 'the other'][1..]
['that', 'the other']
The answer s...more...
|
P1.0
23-Nov-12 |
||
| 42 | 20 |
#50839: "Shadowing: The Name's the Same" section, right at the end "...lest you sew the seeds of scope confusion". When we're talking about seeds, the...more...
|
P1.0
20-Feb-13 |
|
| 46 |
#47363: germanToEnglish: {ja: 'yes', nein: 'no'}
should be
germanToEnglish = {ja: 'yes', nein: 'no'}
Also
germanToEnglish[ja]?
should be
ger...more...
Trevor Burnham says: Thanks for catching that!
|
P1.0
11-Aug-11 |
||
| 46 |
#47923: The second paragraph ends with, "Think of it this way: values live *in* an array, while you have keys *of* an array." Don't you mean, "...have...more...
|
P1.0
09-Nov-11 |
||
| 48 |
#47957: > the next section, we’ll meet one of my favorite antirepetition features. antirepetition -> anti repetition--pichon |
P1.0
17-Nov-11 |
||
| 48 |
#48301: I'd just explain it here, the topic is fresh in the readers mind so its the perfect time to explain.--Colin Jack |
P1.0
15-Dec-11 |
||
| 51 |
#50146: randomLetter() uses the following to generate a random number:
randomNumber = Math.ceil(Math.random() * totalTiles)
However, Math.rand...more...
|
P1.0
07-Nov-12 |
||
| 52 |
#48299: On the 5x5 example, two suggestions.
The first is that I think it'd be good if you provided tests, that way as we write the code we can ru...more...
|
P1.0
15-Dec-11 |
||
| 52 |
#50149: I see no reason to transpose the grid for printing.
printGrid() should be:
printGrid = ->
rowStrings = (' ' + row.join(' | ') for r...more...
|
P1.0
07-Nov-12 |
||
| 54 |
#47582: the call scoreMove in promptForTile2 refers to the coordinate in a different order than previously defined in the code x1, y1, x2, y2
may b...more...
|
P1.0
16-Sep-11 |
||
| 64 |
#48019: tribble1 = new Tribble
tribble2 = new Tribble
tribble1.die() ...more...
|
P1.0
23-Nov-11 |
||
| 64 |
#48296: I get what you are saying but I think it could do with rewording:
"Each time a new tribble is created, Tribble.count is increased by one. (...more...
|
P1.0
15-Dec-11 |
||
| 64 |
#48297: I think a diagram would help with the paragraph starting: "Notice that Tribble.count is referred to as" --Colin Jack |
P1.0
15-Dec-11 |
||
| 68 |
#48378: End of section 3.3:
germanToEnglish: {ja: 'yes', nein: 'no'} should be germanToEnglish = {ja: 'yes', nein: 'no'} in order for the next line t...more...
|
P1.0
21-Dec-11 |
||
| 69 |
#47581: global instead of exports in the explanation of the first statement of OWL2.js--Eugene Van den Bulke |
P1.0
16-Sep-11 |
||
| 72 |
#47946: At the very top of the page it shows the code to require the external files in console.coffee:
{Dictionary} = require './Dictionary'
{Gr...more...
|
P1.0
14-Nov-11 |
||
| 73 |
#48319: "We haven’t discussed bound functions on classes, so perhaps a
demonstration is in order."
Was thinking it might actually be worth a small...more...
|
P1.0
16-Dec-11 |
||
| 77 |
#48328: "$('h1').click -> $(this).html $(this).html() + '!'"
As you say earlier this sort of code can be baffling so it seems pretty odd using it a...more...
|
P1.0
16-Dec-11 |
||
| 79 |
#48329: "Web Interactivity with jQuery"
This chapter is excellent, when starting out with jQuery I wish I'd had this to read. Also pointing out inc...more...
|
P1.0
16-Dec-11 |
||
| 80 |
#49470: The drawTiles function iterates through y before x in the repo
Instead of:
for x in [0...blah]
for y in [0...blah]
...the jq5x5.coff...more...
|
P1.0
29-Jun-12 |
||
| 80 |
#48354: "We’re going to create a browser-based version of the game from the last chapter using the same three class files"
I think it'd be worth ex...more...
|
P1.0
18-Dec-11 |
||
| 81 |
#48353: "However, for our purposes, in-browser compilation will do fine"
My experience is it didn't, I tried typing in the example and unsurprising...more...
|
P1.0
18-Dec-11 |
||
| 85 |
#48355: I think this line could have done with some explanation: "[x, y] = @id.match(/(\d+)_(\d+)/)[1..]"--Colin Jack |
P1.0
18-Dec-11 |
||
| 86 |
#48350: I know its only an example app but you could make the code say this by having a variable "isFirstMove":
"If selectedCoordinates is null, th...more...
|
P1.0
18-Dec-11 |
||
| 86 |
#48351: I'm maybe way off but is it not worth breaking this up a bit?
$notice = $("""
<p class="notice">
#{currPlayer} formed the following #{new...more...
|
P1.0
18-Dec-11 |
||
| 86 |
#48352: Looking at lines like this I'm wondering if its worth somewhere describing when you would recommend using and not using parentheses to improve...more...
|
P1.0
18-Dec-11 |
||
| 86 |
#48360: "selectedCoordinates.x2 = x
selectedCoordinates.y2 = y"
Might be worth just explaining why you're using this approach not = {x2...}. I rea...more...
|
P1.0
18-Dec-11 |
||
| 86 |
#48361: I'm thinking this should be in a paragraph with class notice: $notice = $("#{currPlayer.name} formed no words this turn.")--Colin Jack |
P1.0
18-Dec-11 |
||
| 93 |
#47785: For the 5x5 demo game, the Player.coffee listing does not indicate that the "scoreMove" function is to be included in this file (as within the...more...
|
P1.0
19-Oct-11 |
||
| 97 |
#48021: When I download 5x5server.coffee, it is expecting a Game.coffee but it is not described what is that? Or am I missing something?--Swaroop |
P1.0
23-Nov-11 |
||
| 100 |
#47958: game = new Game
This won't work since a) the game file is not required (it is in the sample code but that's not mentioned in the text) and ...more...
|
P1.0
17-Nov-11 |
||
| 100 |
#47959: If we run the app as suggested in the beginning of the page, it will lead to an error, because socket.io is not installed. The issue here is t...more...
|
P1.0
17-Nov-11 |
||
| 103 |
#48888: Section 2.2, scope example not working as expected -- text says I should expect a function to modify the value of a variable first declared be...more...
|
P1.0
05-Mar-12 |
||
| 103 |
#48889: Re item 103 that I just submitted: if I run the example from REPL (coffee> prompt), it behaves one way; if I edit a file with the same script ...more...
|
P1.0
05-Mar-12 |
||
| 112 |
#48318: "As a rule, you should never use the same name for a prototype property and an instance property."
The exmaple was a good one and its excel...more...
|
P1.0
16-Dec-11 |
||
| 116 |
#47346: The page reference at the top of the page should be 96 instead of 89.--R. Mark Volkmann |
P1.0
05-Aug-11 |
||
| 121 |
#50424: typeof x != 'undefined' && x !== null should be typeof x !== 'undefined' && x !== null--Andreas Kemkes |
P1.0
01-Jan-13 |
||
| 121 |
#50425: Trying x ?= y on coffeescript.org results in:
"the variable "x" can't be assigned with ?= because it has not been defined."
(coffeescript....more...
|
P1.0
01-Jan-13 |
||
| 2004 | MDTlb |
#50103: I want to show some thanks to this wietrr for bailing me out of such a scenario. After surfing around through the online world and meeting thi...more...
|
P1.0
01-Nov-12 |
Stuff To Be Considered in the Next Edition
| Paper | Description | Found in | Fixed in | |
|---|---|---|---|---|
| 20 |
#47372: The "Shadowing" bar ends with: "...lest you sew the seeds of scope confusion." This is the wrong homonym. Should be "sow" in this case, as the...more...
Trevor Burnham says: Good catch! Apparently I need a crash course on metaphors.
|
P1.0
12-Aug-11 |
||
| 26 |
#47345: I think "can have an argument with several default values" should be "can have several arguments with default values".--R. Mark Volkmann Trevor Burnham says: Whoops! Thanks for catching that. |
P1.0
05-Aug-11 |
||
| 27 |
#47322: In purple box: This (or it's equivalent, a||=b) ... Wrong its.--Chris Proctor Trevor Burnham says: Thanks for reporting this! I don't usually make that mistake, but its something that happens to all of us. |
P1.0
29-Jul-11 |
||
| 33 |
#47238: The second question in the first exercise of chapter two seems totally out of place.--Nicolas Buduroi Trevor Burnham says: Sorry, the book is already going to the printer, so these sorts of flaws will have to wait until the next edition to get ironed out. |
B3.0
30-Jun-11 |
||
| 86 |
#47247: The example in Chapter 2, creating a stdin prompt for the 5x5 game, the strToCoordinates function in the book only uses the isInteger check, b...more...
|
B3.0
05-Jul-11 |
||
| 122 |
#47277: x in arr y.indexOf(x) >= 0* where y should probably be arr, no?--Chris Ryland Trevor Burnham says: D'oh. Thanks for spotting this. |
B3.0
18-Jul-11 |

