Skip to content

Conversation

@bpetermann
Copy link

@bpetermann bpetermann commented Aug 19, 2023

Hi,
the counter class gave me the following error messages:

  • counter is not defined
  • After initialization (this.counter = 0) "counter is read-only"

Removing Object.freeze and returning the instance in the constructor should resolve this issue.

Otherwise, as in the Objects example, counter can also be initiated outside the class: let counter = 0;
After that, however, the "this" keyword would have to be removed from the methods.

Thanks!

@vercel
Copy link

vercel bot commented Aug 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fm-workshop-2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2023 0:55am

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

Successfully merging this pull request may close these issues.

1 participant