title: Why does 'instanceof' in TypeScript give me the error "'Foo' only refers to a type, but is being used as a value here."?
body: <p>I wrote this code</p>
  
  <pre><code>interface Foo {
      abcdef: number;
  }
  
  let x: Foo | string;
  
  if (x instanceof Foo) {
      // ...
  }
  </code></pre>
  
  <p>But TypeScript gave me this error:</p>
  
  <pre><code>'Foo' only refers to a type, but is being used as a value here.
  </code></pre>
  
  <p>Why is this happening? I thought that <code>instanceof</code> could check whether my value has a given type, but TypeScript seems not to like this.</p>