title: Display Enum key as string in TypeScript / Angular 4+
body: <pre><code>export enum Type {
      TYPE_1 : "Apple",
      TYPE_2 : "Orange",
      TYPE_3 : "Banana"
  }
  </code></pre>
  
  <p>When I log <code>Type.TYPE_1</code>, <code>toString</code> method is called by default.</p>
  
  <pre><code>console.log(Type.TYPE_1 + " is " + Type.TYPE_1.toString());
  
  Output =&gt; Apple is Apple
  </code></pre>
  
  <p>My expectation is result is like</p>
  
  <pre><code>Output : TYPE_1 is Apple
  </code></pre>
  
  <p>How can I log/get the key <code>TYPE_1</code> as string?</p>
  
  <p><em>Is there way to do <code>override method</code> like as below?</em></p>
  
  <pre><code>export enum Type {
      TYPE_1 : "Apple",
      TYPE_2 : "Orange",
      TYPE_3 : "Banana"
  
      toString() {
          this.key + " is " + this.toString();
          &lt;or&gt;
          this.key + " is " + this.value();
      }
  }
  </code></pre>
  
  <p>I already googling for that, I am not OK yet.</p>
  
  <p><strong>Update</strong></p>
  
  <p>The purpose is to show in UI</p>
  
  <pre><code>export enum Currency {
      USD : "US Dollar",
      MYR : "Malaysian Ringgit",
      SGD : "Singapore Dollar",
      INR : "Indian Rupee",
      JPY : "Japanese Yen"
  }
  
  currencyList : Currency[]= [Currency.USD, Currency.MYR, Currency.SGD, Currency.INR, Currency.JPY];
  
  &lt;table&gt;
      &lt;tr *ngFor="let currency of currencyList"&gt;
          &lt;td&gt;
              &lt;input name="radioGroup" type="radio" [(ngModel)]="selectedType" [value]="currency"&gt;
  
              &lt;label&gt;{{currency}} is {{currency.toString()}}&lt;/label&gt;    
              &lt;!--
                  here expectiation is Example 
                      USD is US Dollar
                      MYR is Malaysian Ringgit
                      SGD is Singapore Dollar
                      ....
  
                  Now I get "US Dollar is US Dollar"....
              --&gt;             
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>