Skip to content
New issue

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

Static Methods Codeblock - website error #983

Open
Thomascountz opened this issue Jun 20, 2024 · 1 comment
Open

Static Methods Codeblock - website error #983

Thomascountz opened this issue Jun 20, 2024 · 1 comment
Assignees

Comments

@Thomascountz
Copy link

When calling a static method, instead of referencing an object instance, you reference the name of the class. Here’s the right way to implement the vector addition example:

let v = createVector(0, 0);
let u = createVector(4, 5);
- let w = v.add(u);
let w = p5.Vector.add(v, u);
@Thomascountz Thomascountz changed the title Errata: Static vs. Nonstatic Methods Codeblock Errata: Static Methods Codeblock Jun 20, 2024
@shiffman shiffman self-assigned this Sep 24, 2024
@shiffman shiffman changed the title Errata: Static Methods Codeblock Static Methods Codeblock - website error Oct 8, 2024
@shiffman
Copy link
Member

shiffman commented Oct 8, 2024

This is actually correct in the print version of the book....

Screenshot 2024-10-07 at 8 20 05 PM

...but not rendering correctly online:

Screenshot 2024-10-07 at 8 21 19 PM

@jasongao97 can you look into this?

@shiffman shiffman assigned jasongao97 and unassigned shiffman Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants