{"version":"1.0","type":"rich","title":"inheritance-2.js","description":"This example demonstrates JavaScript prototype-based inheritance by defining a Person constructor with a getInfoCard method, then creating a Student subclass that inherits from Person via `Object.create(Person.prototype)` and calls `Person.call(this, name, age)` to reuse the parent constructor. The code shows how Student instances, created with the `new` keyword, pass `instanceof Person` checks and access inherited methods like `getInfoCard`, while also adding their own `getName` method. It uses no external libraries, relying solely on native JavaScript constructors, prototypes, and object creation to illustrate classical-style inheritance patterns.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-1724e63301445b1d4a5c?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}