title: Difference between using `typeof` a constant and `enum` in Tyepscript
body: <p>What's the difference between using <code>typeof</code> a constant and <code>enum</code>?</p>
  <p>Example:</p>
  <pre class="lang-js prettyprint-override"><code>const TYPE_A = 'a'
  const TYPE_B = 'b'
  type MyType =
    | typeof TYPE_A
    | typeof TYPE_B
  
  type Resut = {
    name: string
    type: MyType
  }
  
  // and 
  
  enum QuestionType {
    A = &quot;a&quot;,
    B = &quot;b&quot;,
  }
  
  type Resut = {
    name: string
    type: MyType
  }
  </code></pre>
  <p>My goal is to use the <code>&quot;a&quot;</code> and <code>&quot;b&quot;</code> values also in other parts of the code. This is why I proposed the <code>typeof variable</code> but I dont' know if is the better solution.</p>
  <p>I saw there is also <code>const enum</code> but I didn't understand the difference</p>