title: how to use enum in react/typescript
body: <p>There are three examples about enums like one, two, three. And I call function respond with different param. The second result puzzles me. I think TS will check type like the first example and tell me the problem.（Argument of type '"test"' is not assignable to parameter of type 'Response'.ts）The number 9 is not exit in Response but it not throw errors! How to ensure the type safety ? (I mean the respond params have to be number which include in the enum Response not 9 or others)</p>
  
  <pre class="lang-js prettyprint-override"><code>const enum Response {
    No = 0,
    Yes = 1
  }
  
  function respond(message: Response): void {
    console.log(message);
  }
  
  // one
  respond("test");
  // two
  respond(9);
  // three
  respond(Response.Yes);
  </code></pre>
  
  <p>The respond params have to be number which include in the enum Response and TS tell me how to fix it.</p>