JavaScript Array[Symbol.species]

Beginner
6 min read
Updated: Nov 2026

Definition and Usage

Array[Symbol.species] (via the species getter on Array) controls which constructor methods like map use when creating a new array in subclasses.

JavaScript Syntax

JavaScript
class MyArray extends Array {}
const a = MyArray.from([1, 2]);
const b = a.map((x) => x * 2);
console.log(b instanceof MyArray);
console.log(Array[Symbol.species] === Array);
Try it Editor

How It Works

  1. Subclass. MyArray extends Array.
  2. map. Returns another MyArray via species.
  3. Default. Array.species is Array.

Examples

Example 1 — Default species

Built-in Array.

JavaScript
console.log(Array[Symbol.species] === Array);
Try it Editor

How It Works

  1. Species getter returns Array.

Frequently Asked Questions

Only when subclassing Array and customizing what map/filter return.
See Symbol.species under Symbol properties.

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful