K
K
Konstantin2020-06-17 14:41:19
Angular
Konstantin, 2020-06-17 14:41:19

Enum or object, which is better to use?

I have different constant lists with headers:

Fruits

Яблоко
Груша
Вишня


Or another list:

Furniture
Стул
Стол


Behind each value is hidden a certain value: a string or a number.

Where is it better to store these static values, in enumor const objects, map?,

If in enum, then how to store the value and translation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2020-06-17
@Junart1

Enum
Enum as const
Choose the result that suits you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question