- [Instructor] As we mentioned,
because a class is a prototype in itself,
we inherit all of its methods.
So there are multiple methods we can use with it.
Let me demonstrate.
So just for the sake of this video
I'm gonna clean this up a little bit.
Just wanna make sure we only have the instance of a car,
so let's go in.
I will remove this function here,
I will also silence these four
just by commenting them, so Command + Forward slash,
and also remove the sayHi here,
and just keep the class
so we continue working on it in future videos.
Now let's go back to our sandbox,
we should have only this guy here.
So let's explore what this guy has.
Outside of what we declare with this instance of the class,
we also have the prototype of an object.
If we click there, we see what's available
with this particular class.
We have car stats, which we've used,
we also have the constructor car.
If we click on that, we'll see what's available to us.
So everything that you see here is available to us
in JavaScript here.
So we can literally type, for example, car,
and we'd be able to use whatever methods
are part of this car.
So for example we have
the length, we have bind, call,
we have the function that we created,
totalDoors, should be here.
And so on and so forth.
If we continue down that path,
if we close the constructor,
and then open up the prototype object,
we have more functions that we could use.
So these are all methods that you can use
with your object, your classes,
or what it was called before, a prototype.
So let's say for example,
I want to simply transfer this doors four into a string.
I could do something like cx5 which is available to me,
then call the color, and then
toString.
So it's a function and run it.
And then it would transfer it to string,
but it's already a string,
so let's do another example.
So let's use the doors,
which is a number,
and then convert it to string.
And then now the number four is now a string.
So you have multiple functions you have available
depending on what you're using,
so cx5 I have all these things here that I could use,
and I could go crazy with that.
So these are all the methods that are coming
with the classes, with the prototypes,
and with the actual values that you're using,
so sometimes if you wonder
what you can use outside of the methods,
or the functions you can create yourself with a class,
take a look at what JavaScript offers here,
in the sandbox, and explore and test and try new functions,
and you'll see what you can do.