We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi and thank you for this really helpful book.
I think I might have spotted a very minor mistake in the OOP section? Under "classes" there's the following snippet: https://github.com/software-tools-in-javascript/js4ds/blob/a15c852e4b2df6d19380ee80075eb8cc5aeb6421/oop.tex#L211
for (let thing of everything) { const a = thing.area(thing) const p = thing.perimeter(thing) console.log(`${thing.name}: area ${a} perimeter ${p}`) }
Notice the snippet shows passing the instance into itself (const a = thing.area(thing)).
const a = thing.area(thing)
But this is right after the text has gone to great lengths to explain that
Building every object by hand and calling thing.function(thing) is clumsy
thing.function(thing)
and why you don't need to do that with classes.
I tested the snippet without passing thing into the method calls
thing
for (let thing of everything) { const a = thing.area() const p = thing.perimeter() console.log(`${thing.name}: area ${a} perimeter ${p}`) }
and it worked as expected.
Should those extra things be removed?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi and thank you for this really helpful book.
I think I might have spotted a very minor mistake in the OOP section?
Under "classes" there's the following snippet:
https://github.com/software-tools-in-javascript/js4ds/blob/a15c852e4b2df6d19380ee80075eb8cc5aeb6421/oop.tex#L211
Notice the snippet shows passing the instance into itself (
const a = thing.area(thing)
).But this is right after the text has gone to great lengths to explain that
and why you don't need to do that with classes.
I tested the snippet without passing
thing
into the method callsand it worked as expected.
Should those extra
thing
s be removed?The text was updated successfully, but these errors were encountered: