View Single Post
  #6 (permalink)  
Old May 21st, 2005, 10:47 AM
AGS AGS is offline
Wrox Technical Editor
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2005
Location: Russia
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nicholas,

Page 73, first code sample

Code:
var aColors = [“red”, “green”, “blue”];
var aColors2 = arr.concat(“yellow”, “purple”);
alert(aColors2.toString()); //outputs “red,green,blue,yellow,purple”
alert(aColors.toString()); //outputs “red,green,blue”
Presumably the second line should be
Code:
var aColors2 = aColors.concat("yellow", "purple");
and the same in the following example
Code:
var aColors = [“red”, “green”, “blue”, “yellow”, “purple”];
var aColors2 = arr.slice(1);
var aColors3 = arr.slice(1, 4);
alert(aColors2.toString()); //outputs “green,blue,yellow,purple”
alert(aColors3.toString()); //outputs “green,blue,yellow”
 
Quote:
quote:Here, aColors2 contains all the items in arr from position 1 on.

arr instead of aColors

As for your remark “you'd make a good technical editor”, well, I would be happy to edit your next book ;).

Best regards
Alexei
Reply With Quote