H
H
Hlib2020-12-31 08:01:35
typescript
Hlib, 2020-12-31 08:01:35

How to set the type of an array of arrays in typescript?

Hello everyone, a task has appeared, you need to specify the type of option in the interface.
An array of arrays of dates is passed into this option, the following cases are possible:

//someDate = new Date();


;

And there are infinitely many of them
. How to define such a thing?
PS
What about ? Does the syntax support this at all, and how crutch does it look? Array<Array>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twolegs, 2020-12-31
@Mysianio

I think it's more correct to use tuple in this case. Well, then the type is defined simply as
Option[]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question