Сообщение от Raadsert
|
console.log(arr.text)
|
Как вариант...
type fruits = {
id: string,
data: string
}
type vegetables = {
id: string,
text: string
}
let arr: (fruits | vegetables)[] = [
{id: "1", data: "sadsa"},
{id: "2", text: "sdsadsa"}
]
const o = arr[1] as vegetables
console.log(o.text)