Products
Features
YouTube Video Summarizer
Summarize YouTube videos
Web & PDF Highlighter
Highlight web pages & PDFs
Chat with PDF
Ask any PDF questions with AI
Ask AI Clone
Chat with your highlights & memories
Audio Transcriber
Transcribe audio files to text
Glasp Reader
Read and highlight articles
Kindle Highlight Export
Export your Kindle highlights
Idea Hatch
Hatch ideas from your highlights
Integrations
Obsidian Plugin
Notion Integration
Pocket Integration
Instapaper Integration
Medium Integration
Readwise Integration
Snipd Integration
Hypothesis Integration
Apps & Extensions
Chrome Extension
Safari Extension
Edge Add-ons
Firefox Add-ons
iOS App
Android App
Discover
Discover
Ideas
Discover new ideas and insights
Articles
Curated articles and insights
Books
Book recommendations by great minds
Posts
Essays and notes from readers
Quotes
Inspiring quotes collection
Videos
Curated videos and summaries
Explore Glasp
Glasp Newsletter
Weekly insights and updates
Glasp Talk
Interview series with great minds
Glasp Blog
Latest news and articles
Glasp Use Cases
Learn how others use Glasp
Build & Support
Glasp API
Access Glasp's API for developers
MCP Connector
Connect Glasp to Claude & ChatGPT
Community
Glasp Reddit Community
Students
Student discount and benefits
FAQs
Frequently Asked Questions
AboutPricing
DashboardLog inSign up

16.18: Polymorphism in JavaScript - Topics of JavaScript/ES6

63.9K views
•
March 1, 2019
by
The Coding Train
YouTube video player
16.18: Polymorphism in JavaScript - Topics of JavaScript/ES6

TL;DR

Polymorphism in JavaScript allows objects of different types to be treated as the same object and execute functions accordingly, even in a loosely typed language like JavaScript.

Transcript

  • I've got one more topic here, about object orientated programming in ES6 with classes, and that is what is polymorphism? And what does polymorphism mean, and how is it applied in JavaScript? So just a review, the core idea of object orientated programming, creating a blueprint, a template as a class, that makes, that encapsulates a whole bunch of... Read More

Key Insights

  • ❓ Object-oriented programming involves encapsulation and inheritance.
  • 👻 Polymorphism allows objects to be treated as different types and execute relevant functions.
  • 👻 JavaScript, being a loosely typed language, allows for flexible polymorphism.
  • 🅰️ Strongly typed languages achieve polymorphism through explicit typing.
  • 📚 The p5 library in JavaScript provides useful tools, such as the p5.Vector object, which can be extended through inheritance.
  • 🌲 Understanding the prototype chain and inheritance tree is crucial for comprehending the hierarchy and relationships between objects.
  • 🅰️ Polymorphism simplifies the management of arrays containing different types of objects.

Install to Summarize YouTube Videos and Get Transcripts

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is encapsulation in object-oriented programming?

Encapsulation refers to the idea of creating a class as a template that encapsulates both data and functionality together, providing a convenient package for objects.

Q: How is inheritance defined in object-oriented programming?

Inheritance allows a class to inherit properties or functions from another class while allowing for modifications and customization specific to the inheriting class.

Q: What is polymorphism in JavaScript?

Polymorphism in JavaScript means that an object can be treated as multiple types, such as a Confetti object or a Particle object, depending on what is convenient. The system can determine which functions to execute correctly.

Q: How does polymorphism work in a strongly typed language?

In a strongly typed language, polymorphism is achieved through explicit typing, where variables are declared with specific types. Objects can be treated as different types, and functions specific to those types can be executed.

Summary & Key Takeaways

  • The core ideas of object-oriented programming include encapsulation, which involves creating a blueprint or template as a class to encapsulate data and functionality, and inheritance, which allows a class to inherit properties or functions from another class.

  • Polymorphism in JavaScript means that an object can be treated as multiple types and the system can determine how to execute the correct functions based on the context.

  • In a strongly typed language, polymorphism is achieved through explicit typing, where the type of a variable is declared and cannot be changed. However, JavaScript's flexible nature makes it less apparent.


Read in Other Languages (beta)

English

Share This Summary 📚

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Explore More Summaries from The Coding Train 📚

9.4: Genetic Algorithm: Looking at Code - The Nature of Code thumbnail
9.4: Genetic Algorithm: Looking at Code - The Nature of Code
The Coding Train
Coding Challenge #126: Toothpicks thumbnail
Coding Challenge #126: Toothpicks
The Coding Train
Classifying Poses with ml5.js Part 2 thumbnail
Classifying Poses with ml5.js Part 2
The Coding Train
Text Generation using Spell with Nabil Hassein thumbnail
Text Generation using Spell with Nabil Hassein
The Coding Train
8.1: Fractals - The Nature of Code thumbnail
8.1: Fractals - The Nature of Code
The Coding Train
ITP/IMA Winter Show 2019 thumbnail
ITP/IMA Winter Show 2019
The Coding Train

Summarize YouTube Videos and Get Video Transcripts with 1-Click

Download browser extensions on:

Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator

Apps & Extensions

  • Chrome Extension
  • Safari Extension
  • Edge Add-ons
  • Firefox Add-ons
  • iOS App
  • Android App

Key Features

  • YouTube Video Summarizer
  • Web & PDF Summarizer
  • Web & PDF Highlighter
  • Chat with PDF
  • Ask AI Clone
  • Audio Transcriber
  • Glasp Reader
  • Kindle Highlight Export
  • Idea Hatch

Integrations

  • Obsidian Plugin
  • Notion Integration
  • Pocket Integration
  • Instapaper Integration
  • Medium Integration
  • Readwise Integration
  • Snipd Integration
  • Hypothesis Integration

More Features

  • APIs
  • MCP Connector
  • Blog & Post
  • Embed Links
  • Image Highlight
  • Personality Test
  • Quote Shots

Company

  • About us
  • Blog
  • Community
  • FAQs
  • Job Board
  • Newsletter
  • Pricing
Terms

•

Privacy

•

Guidelines

© 2026 Glasp Inc. All rights reserved.