title: I have a simple regular expression which works in one case but doesnt in another
body: <pre><code>console.log(/j/i.test(undefined)); &gt;&gt; false
  console.log(/i/i.test(undefined)); &gt;&gt; true
  </code></pre>
  
  <p>/i/i is regular expression to test i in passed string which not defined(undefined)</p>