The following types encompass every value in JavaScript:

- `boolean`
- `number`
- `undefined` (which includes the single value `undefined`)
- `string`
- `symbol` (abstract unique "things" that are compared by reference)
- `object`

Every object (i.e. everything) in JavaScript has a prototype, which is a kind of object.

The prototype contains functions, which are also a kind of object<sup>1</sup>.

Objects also have a constructor, which is a function, and therefore a kind of object.

[![nested][1]][1]

It's all recursive, but the implementation is able to do it automagically because, unlike JavaScript code, it can create objects without having to call JavaScript functions (since objects are just memory that the implementation controls).

Most object systems in many dynamically typed languages are circular<sup>2</sup> like this. For example, in Python, classes are objects, and the class of classes is `type`, so `type` is therefore an instance of itself.

The best idea is to just use the tools that the language provides, and not think too much about how they got there.

<sup>1 Functions are rather special because they are callable, and they are the only values that can contain opaque data (their body and possibly a closure).</sup>

<sup>2 It's actually more of a tortured, branching ribbon bent backwards over itself, but "circular" is close enough.</sup>

  [1]: https://i.sstatic.net/nZAKV.png