Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. JavaScript Course

Lesson 23 of 55 · javascript

Prototype Chain & Inheritance

Duration: 10 mins

Every object has an internal [[Prototype]] (accessible via Object.getPrototypeOf).

const animal = { eats:true };
const rabbit = Object.create(animal);
rabbit.jumps = true;
console.log(rabbit.eats); // true – found on prototype

Prototype methods – Object.prototype.toString, Array.prototype.map.

Example: Adding a method to all objects

Object.prototype.log = function(){ console.log(this); };
({a:1}).log(); // {a:1}

(Use with caution – augmenting native prototypes can break libraries.)

Previous: Classes – ES6 Syntax, Inheritance, Getters/Setters, staticNext: Modules Bundlers – Webpack, Rollup, Vite