How to type for following data. I have to type for progress object
const progress = { "1": { topic: [1,3,4], assessment: [1,2,4,], }, "2": { topic: [1,3,4], assessment: [1,2,4,], }, .... }
Advertisement
Answer
There is built-in type – Record<K, V>
type Obj = Record<string, {topic: number[], assessment: number[]}>