paint-brush
What Is an Array Type in Typescriptby@smpnjn
3,386 reads
3,386 reads

What Is an Array Type in Typescript

by Johnny Simpson2mJuly 12th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Arrays work the same in TypeScript as they do in Javascript, the only difference is that we have to define their type upfront. Defining an array's type can be confusing at first, so let's look at how it works. Arrays, by their nature, are an ordered list of data. For example, an array of numbers could be defined like this: number[] = [ 1, 2, 3, 4] Arrays can be defined using the same format as before.
featured image - What Is an Array Type in Typescript
Johnny Simpson HackerNoon profile picture
Johnny Simpson

Johnny Simpson

@smpnjn

Product, Engineering, Web

About @smpnjn
LEARN MORE ABOUT @SMPNJN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Johnny Simpson HackerNoon profile picture
Johnny Simpson@smpnjn
Product, Engineering, Web

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite