Похожие чаты

Is it better to do this or that for Typescript

types? string[] vs [string]

5 ответов

18 просмотров

those arent the same i think. [string] is a tuple and only 1 string string[] is an array, any amount but all elements have to be string

Ed-E Автор вопроса
David
those arent the same i think. [string] is a tuple...

Tuple are just array with two values no?

Ed E
Tuple are just array with two values no?

No, tuple is array with specified length

readonly string[] if you can 😛

Похожие вопросы

Обсуждают сегодня

Карта сайта