title: What is the difference between enum and object in typescript
body: <p>I am trying to access values of a map via enum and also make a translation ready app for all the strings in it.
  Both concerns overlap and I have to decide between using enums or just object in JSON format.</p>
  
  <p>So what exactly is the difference and useage between an enum and an object?</p>
  
  <p>For example:</p>
  
  <ul>
  <li>I can use enums to access arrays as well as inserting labels and other stuff like</li>
  </ul>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const enum FieldNames {
    FirstField: "Field One",
    SecondField: "Field Two"
  };
      
  someFieldArray[FieldNames.FirstField].label = FieldNames.FirstField;
  someFieldArray[FieldNames.SecondField].label = FieldNames.SecondField;</code></pre>
  </div>
  </div>
  </p>
  
  <ul>
  <li>Or I can achieve the same behaviour via object</li>
  </ul>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const FieldNames = {
    FirstField: "Field One",
    SecondField: "Field Two"
  };
  
  someFieldArray[FieldNames.FirstField].label = FieldNames.FirstField;
  someFieldArray[FieldNames.SecondField].label = FieldNames.SecondField;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I really do not get the benefit choosing enums over simple objects. In my opinion an object has much more benefits without any downsides.</p>