title: how typescript enum value compares?
body: <p><a href="https://i.stack.imgur.com/LmFdE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LmFdE.png" alt="enter image description here" /></a></p>
  <pre><code>enum A {
     a = 1,
     b = 2
  }
  
  namespace N1 {
     export enum A {
         a = 1,
         b = 2
     }
  }
  // it will pass type check
  console.log(A.a === N1.A.a)
  </code></pre>
  <p>when I remove const keyword, the expression will pass type check.</p>
  <p>But if const was added, tsc says</p>
  <blockquote>
  <p>This condition will always return 'false' since the types 'A' and
  'N1.A' have no overlap.</p>
  </blockquote>
  <p>I want to know how enums in TS compare enum value under the hood.</p>