Articles → JavaScript → Enums In JavaScript
Enums In JavaScript
Purpose
Syntax
var variable_name = {enumerator_1:value, enumerator_2:value….}
Example
<script>
var contentType = { Articles: "Articles", InterviewQuestions: "Interview Questions" };
console.log(contentType.InterviewQuestions);
</script>
Try It
Output