JavaScript Prototype Inheritance Example

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.

Code Overview

  • TheParent: The parent constructor function with a name property and a print method.
  • TheChild: The child constructor function that inherits from TheParent and adds a unique lastname property.

How to Use

  1. Clone the repository:

    git clone https://github.com/yourusername/JavaScript-Prototype-Inheritance.git
  2. Open the HTML file in your browser to run the code.

Concept Covered

  • Prototype-based inheritance in JavaScript.
  • Creating and inheriting from constructor functions.
  • Use of prototype objects to share methods and properties.

License

This project is licensed under the MIT License - see the LICENSE file for details.