This repository contains a JavaScript code example that demonstrates prototype inheritance in JavaScript. It includes a parent constructor function, TheParent
, and a child constructor function, TheChild
, which inherits from TheParent
using the inherit
function.
TheParent
: The parent constructor function with aname
property and aprint
method.TheChild
: The child constructor function that inherits fromTheParent
and adds a uniquelastname
property.
-
Clone the repository:
git clone https://github.com/yourusername/JavaScript-Prototype-Inheritance.git
-
Open the HTML file in your browser to run the code.
- Prototype-based inheritance in JavaScript.
- Creating and inheriting from constructor functions.
- Use of prototype objects to share methods and properties.
This project is licensed under the MIT License - see the LICENSE file for details.