title: Is there a downside to using [true, 'true'].includes(someVariable) to check if a value is true?
body: <p>In our system we can not always be sure if a parameter was given as String or as a Boolean value (dynamic typing ahoi!), therefor, if e.g. we want to check if a certain flag was passed as true (so either boolean true or string 'true'), we usually check it using one of these options:</p>
  
  <pre><code>if (condition + '' === 'true')
  </code></pre>
  
  <p>which I don't like because of the implicit typecast</p>
  
  <pre><code>if ({true: true, 'true': true}[condition])
  </code></pre>
  
  <p>which I don't like because it's rather complex to read.</p>
  
  <pre><code>if (condition === true || condition === 'true')
  </code></pre>
  
  <p>which looks somewhat ugly to me and has an old feel to it.</p>
  
  <p>Therefor, since <strong>I want to consider all options</strong> : is there a downside to using this variant:</p>
  
  <pre><code>[true, 'true'].includes(someVariable) 
  </code></pre>
  
  <p>(Besides it being sort of a yoda-condition)</p>
  
  <p><strong>Edit</strong>: For completion, here are even more ways to check what I want to do:</p>
  
  <pre><code>if (condition.toString() === 'true')
  
  if (String(condition) === 'true')
  </code></pre>
  
  <p>I think I'll stick with regular === 'true' || === true, checks, but it I'd still like to have my original question answered if possible.</p>