Answers for "typescript get type of array object"

1

typescript array of object with types

type submitionDataType = {
    title: string,
    desc: string,
    decks: Array<{ front: string, back: string }>
}
Posted by: Guest on August-08-2021
0

get type of element of array typescript

const animals = ['cat', 'dog', 'mouse'] as const
type Animal = typeof animals[number]

// type Animal = 'cat' | 'dog' | 'mouse'
Posted by: Guest on May-01-2021

Code answers related to "typescript get type of array object"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language