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

Usage question: Modify class prototype #16

Open
LukasMachetanz opened this issue Jul 15, 2020 · 1 comment
Open

Usage question: Modify class prototype #16

LukasMachetanz opened this issue Jul 15, 2020 · 1 comment

Comments

@LukasMachetanz
Copy link

Hi again!

I am wondering if it is possible to adjust the prototype of a class declaration? E.g. add specific properties? If anyone has an idea I would really appreciate it.

Thanks in advance.
Greets, Lukas

@itsdouges
Copy link
Owner

hey mate!

you could always update the prototype directly? find a class references and then update the prototype next to it.

class HelloWorld{}
HelloWorld.prototype.sayHello = () => console.log('hello')

const e = new HelloWorld();
e.sayHello()
``

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

2 participants