Array Data Kind

Aug 22, 2023
1 min read 61 words Types
Table of Contents

The array kind is a list of data.

Let skills: string[] = [];

Let stuff: (string|number)[];

stuff = [1, 2, 'bag']

Adding items through array position:

skills[0] = "Eating";
skills[1] = "Sleeping";

Methods

Adding items through push():

skills.push('Eating, Sleeping');
array.length
typeof(array)

forEach()

map()

reduce()

filter()

Tuple

A tuple is a fixed array.

let color: [number, number, number?] // ? is optional

Send us your comments!