Typescript Array Methods

Typescript Array Methods

TypeScript supports arrays, similar to JavaScript. There are two ways to declare an array:

1. Using square brackets. This method is similar to how you would declare arrays in JavaScript.

let fruits: string[] = [‘Apple’, ‘Orange’, ‘Banana’];


2. Using a generic array type, Array<elementType>.

let fruits: Array<string> = [‘Apple’, ‘Orange’, ‘Banana’];


In this article, I’m going to discuss more array methods that are available. Below are some available array methods and their uses.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

To view or add a comment, sign in

More articles by Udara Abeythilake

Others also viewed

Explore content categories