# Prototypal Inheritance

In JavaScript, Array and Functions are inherited from Object.

![Prototypal Inheritance](https://2037876129-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdbqCujxzeJqeQqlbM2%2F-LnXuBrbXAWs0T19qb8e%2F-LnY-SfIdDHo2bWopZUp%2Fimage.png?alt=media\&token=f60167b5-c026-4821-ba88-2d58c37da5a7)

we can see the parent object using `__proto__` property.

```javascript
Examples:
    const arr = [];
    console.log(arr.__proto__) // Array
    console.log(arr.__proto__.__proto__) // Object
    
    function a() {}
    console.log(a.__proto__) // f[native code]
    console.log(a.__proto__.__proto__) // Object
    
    const obj = {};
    console.log(a.__proto__) // Object
```

for more details [check here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain).
