JS visualized learning.

Master JavaScript array methods through interactive visuals and hands-on examples.

// Fill all the elements with a value
const fruits = [ “Banana”, “Orange”, “Apple”, “Mango” ];
fruits.fill(“Kiwi”);

// Fill the last two elements
const fruits = [ “Banana”, “Orange”, “Apple”, “Mango” ];
fruits.fill(“Kiwi”, 2, 4);

Introduction

JavaScript array methods

Learn JavaScript array methods in a new interactive experience.

Explore detailed descriptions, dynamic data flow visualizations, and practical code snippets to boost your JavaScript array skills.


Create an array

An array is a special variable, which can hold more than one value.
The new Array() or [ ] constructors creates a new Array object.

Colors:

Code:

// Create colors array
let colors = [];

At()

The at() method returns an indexed element from an array.
The at() method returns the same as [ ].
The at() method is supported in all modern browsers since March 2022.

Colors:

Select:

Code:

let colors = [];

// Get index
colors.at();
// or
colors[];

Concat()

The concat() method concatenates (joins) two or more arrays.
The concat() method returns a new array, containing the joined arrays.
The concat() method does not change the existing arrays.

Colors 1:

Colors 2:

Children:

Code:

// Join colors1 with colors2
const colors1 = [];
const colors2 = [];
const children = colors1.concat(colors2);
//