title: TypeScript - checking types
body: <p>I was wondering about the type guards in TypeScript, and if it is necessary to use them when only one type is defined in method signature. All examples in TypeScript docs only refer to situations when you have union type, e.g.:</p>
  
  <pre><code>myMethod(argument: string | number) {
   if (typeof argument === 'string') { // do my thing }
   if (typeof argument === 'number') { // do my thing }
  </code></pre>
  
  <p>But I've seen people using typeof when the type is strongly typed:</p>
  
  <pre><code>myMethod(argument: string) {
   if (typeof argument === 'string') { // do my thing }
  </code></pre>
  
  <p>Do you think it's a good approach? How do you check your data, especially the one that is not available during compile (e.g. from API endpoint)?</p>