title: Iterate over generic enum Types Typescript
body: <p>I stumbled across a problem I have which is that I need to iterate over generic enum Types.
  I'm trying to get the values of the enum Type.</p>
  <p>Typescript error in GetPaths function in the for loop parameters:</p>
  <p>&quot;'T' only refers to a type, but is being used as a value here&quot;</p>
  <pre><code>export enum ERoutingPaths {
    Home = &quot;/&quot;,
    About = &quot;/About&quot;
  }
  
  export enum EGamePaths {
    Snake = &quot;/Snake&quot;,
    Maze = &quot;/Maze&quot;,
  }
  
   function GetPaths&lt;T extends ERoutingPaths | EGamePaths&gt;():any {
    let result = &quot;&quot;;
    for (let item in Object.values(T))  {
      result += item + &quot;|&quot;;
    }
    return result;
  }
  </code></pre>
  <p>How can I make a function which allows me to iterate over a generic enum type if I would have other enum types aswell ?</p>