What is a prototype?

Hey, when looking over the MDN documention and Angular stuff, (later), I encounter the word prototype and classes a lot. Can anyone explain what they are? ie. string.prototype?

Replace this line with your code. 

The String.prototype property represents the String prototype object.

Class declarations:

One way to define a class is using a class declaration. To declare a class, you use the class keyword with the name of the class (“Rectangle” here).

class Rectangle {
  constructor(height, width) {
    this.height = height;
    this.width = width;

That is explanatory, but doesn’t give me the definition of what a class, or an instance is. I presume prototype is your specific use case, a generic term.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.