This happens successively until we reach the object object, What is the parent prototype?. The object objects is the end of this prototype chain, because its prototype is null.
let myString = ‘Hello’
So if we insert the variable myString in our editor, it will return ‘Hello’. In addition to this, We can use the variable followed by a period to ask for a variety of properties of our string. We can, for example, write myString.length to ask its length.
When we talk about methods we are referring to functions that are properties of an object and there are many for each object. For example, one of the methods we could use with our string is the method of converting to uppercase. To access this, we use the same command as with a property, as you can see in the following line:
The result of this method will be the following:
This command will return the result String. When we display the arrow next to this result, we will see a bunch of methods and we will find that, in the characteristic of [Prototype], the value is object. Within this object, we will find another _proto_ which tells us that it is an object, under which there is another characteristic _proto_ which has as value null. This feature tree is what we know as the prototype chain.
Do you want to continue learning?