Inspired from Inheritance and the prototype chain on this page, I decided to figure out prototype chains of all standard built-in objects in Javascript.

First we defined a function to print the chain.

Now, we test it out for all the standard built-in objects collected from here.

Output:

As you can see, most of them are specialized functions that inherit from the function function, which inherits from the object Object, which inherits from null.

JSON and Math are the exceptions as they inherit from the object Object directly.

Also, it shows that typeof nullis an object.

Let’s try it with some real values

Output:

Look more carefully, and see what they are. You could also inspect each node in the browser dev tools, which will provide more insight as they won’t be have to be printed in just plain string.