{"version":"1.0","type":"rich","title":"inheritance-0.js","description":"The example demonstrates JavaScript prototype-based inheritance through a `Person` constructor function, where `getInfoCard` is defined on `Person.prototype` and returns a formatted name-and-age string. It shows how a `Student` constructor inherits this method, allowing an instance created with `new Student('John', 18, 'MIT')` to call it successfully. It also highlights a common pitfall: invoking `Student` without `new` assigns properties to the global object and causes `getInfoCard` to fail, since the returned value is not an object with that method. No external libraries are used; the code relies solely on core JavaScript constructors, `prototype`, and `instanceof` checks (commented out).","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-042f09cc2e33b996f246?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}