title: RegEx.test() vs Comparison Operator Performance
body: <p>I'm wondering if there are any major performance differences between the following. Obviously there is a nice tidiness to the first.</p>
  
  <pre><code>var value = 'a';
  
  if (/^[a-d]$/.test(value)) {
      // do something...
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>if (value === 'a' || value === 'b' || value === 'c' || value === 'd') {
      // do something
  }
  </code></pre>
  
  <p>I did find this, but it seems to be server side based, rather than client side (this is for an iOS web app):</p>
  
  <p><a href="https://stackoverflow.com/questions/3749886/regular-expression-vs-string-comparison-operators-functions">&#39;Regular Expression&#39; VS &#39;String Comparison operators / functions&#39;</a></p>