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

explain javascript prototype #5

Open
smcalilly opened this issue Mar 17, 2021 · 0 comments
Open

explain javascript prototype #5

smcalilly opened this issue Mar 17, 2021 · 0 comments

Comments

@smcalilly
Copy link
Owner

When you introduce the concept of an object I found it helpful to play around with sayHello in the repl to when following along the Mozilla article you link to. Might want to add a real illustration here where the reader runs object.getPrototypeOf(sayHello) and sayHello.prototype. That drove home what a prototype is for me. It's like a template for an object. A prototype is like a "class" in Ruby I think. At least it seems like the same concept as something like say_hello.class which if you went far enough up the chain ruby you'd arrive at method the same way sayHello.prototype returns function

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

1 participant