JavaScript uses a prototype-based inheritance model, where objects can inherit properties and methods from other objects. Let's dive into how…