How can I define an enum in JavaScript?

Enums are part of TypeScript, but what about defininf enums in plain old JavaScript? Here are a few way you can do that.


This content originally appeared on 30 seconds of code and was authored by 30 seconds of code

Enums are part of TypeScript, but what about defininf enums in plain old JavaScript? Here are a few way you can do that.


This content originally appeared on 30 seconds of code and was authored by 30 seconds of code


Print Share Comment Cite Upload Translate Updates
APA

30 seconds of code | Sciencx (2021-05-24T09:00:00+00:00) How can I define an enum in JavaScript?. Retrieved from https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/

MLA
" » How can I define an enum in JavaScript?." 30 seconds of code | Sciencx - Monday May 24, 2021, https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/
HARVARD
30 seconds of code | Sciencx Monday May 24, 2021 » How can I define an enum in JavaScript?., viewed ,<https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/>
VANCOUVER
30 seconds of code | Sciencx - » How can I define an enum in JavaScript?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/
CHICAGO
" » How can I define an enum in JavaScript?." 30 seconds of code | Sciencx - Accessed . https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/
IEEE
" » How can I define an enum in JavaScript?." 30 seconds of code | Sciencx [Online]. Available: https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/. [Accessed: ]
rf:citation
» How can I define an enum in JavaScript? | 30 seconds of code | Sciencx | https://www.scien.cx/2021/05/24/how-can-i-define-an-enum-in-javascript-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.