title: Typescript string to boolean
body: <p>I am trying to convert a string to boolean. There are several ways of doing it 
  one way is</p>
  
  <pre><code>let input = "true";
  let boolVar = (input === 'true');
  </code></pre>
  
  <p>The problem here is that I have to validate input if it is true or false. Instead of validating first input and then do the conversion is there any more elegant way?
  In .NET we have <code>bool.TryParse</code> which returns false if the string is not valid. Is there any equivalent in typescript?</p>