Answer the question
In order to leave comments, you need to log in
How to declare an Object in which an arbitrary set of fields, but all fields are Array?
There is such an object
const obj = {
field1: [],
field2: [],
somefield: ['one']
}
Answer the question
In order to leave comments, you need to log in
You need a Record type
const obj: Record<string, string[]> = {
field1: [],
field2: [],
somefield: ['one'],
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question