Problem with Ex23


I run into an error (TypeError: xxx.volume is not a function) when I try to change the volume of an object that’s an instance of Jazzmaster by calling its volume method. The problem goes away when I change the name of the method - I changed it to adj_volume(level) from volume(level).

Is it valid that to have an attribute say this.volume and a method with same name say volume(level) in one class?

Same problem with tone.


No. Member names must be unique.

Thanks! So I guess this part of the book needs to be fixed.

A free service run by Zed A. Shaw for