DEV Community

Discussion on: Explain Enumeration in computing

Collapse
 
nestedsoftware profile image
Nested Software • Edited

Are you referring to an ‘enum’ type? If so, it’s a type that allows you to define a finite sequence of named values for that type. Here’s an example from typescript:

enum Cardsuit {
    Clubs, 
    Diamonds, 
    Hearts, 
    Spades
};

var c: Cardsuit = Cardsuit.Diamonds;

Not all languages have enums. You can read more about it on Wikipedia: en.m.wikipedia.org/wiki/Enumerated...

Collapse
 
mah3uz profile image
Mahfuz Shaikh

Thank you