Ask coding questions

← Back to all posts
JS Assignment 14: The Class Prototype
Kevinw980 (0)

I'm fairly new to coding and never really learned about classes or prototypes and I can't for the life of me figure out the solution to either of the questions. (I'm sure it's obvious but I'm coming up with a total blank).

vedprad1 (732)

A prototype is kind of like a new class that the original class takes functions from. Here is the basic format.

[ClassName].prototype.[functionName] = function ([parameters]) {
  //The code in the function

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

Kevinw980 (0)

@vedprad1 That helps out quite a lot, thank you for that. Can you help like explain a class, I get the concept but have a hard time putting it into the code.