Похожие чаты

So... i have an object like this: const foo = [

{ label: "Lorem", value: "flash" },
{ label: "Lorem ", value: 3 },
{ label: "Lorem ", value: 5 },
];
And i want to know how can i extract all the type from all the property "value" of the objects in this array... any idea how can i get this done with ts? any resources that i can check?

8 ответов

10 просмотров

How do you want it here? Send what you are expecting

Isaac-. Автор вопроса

i want to get something like this

Isaac .
i want to get something like this

You want it as key value pair

Isaac-. Автор вопроса
Arthur™
You want it as key value pair

is what i posted not an union type? 🤔 (type1 | type2 | type3 | .. | typeN) -> union type

Isaac-. Автор вопроса
Darvesh 🍀
Send the exact type you want in code

typesFromArrayObject === all the types that exist in the 'value' field of the objects than contain the array that i send earlier

Isaac-. Автор вопроса

Похожие вопросы

Обсуждают сегодня

Карта сайта