It has been quite sometime when I explored different ways of implementing Enums in javaScript
say I have an Enum names as Medium
as
Medium : {
ONLINE : {id: 1, desc: "Online"},
CREDIT : {id: 2, desc: "Credit Card"},
DEBIT : {id: 3, desc: "Debit Card"},
NETBANKING : {id: 4, desc: "Net Banking"}
}
say I got an information that medium is 3. Now from this information how can I get the details like description. In this case it should return "Debit card".
Searched a lot on internet but not able to get any lead.