title: Using regular expression ,if and else conflict with .test() function
body: <p>In the given code, <code>best.test(password)</code> is returning true but when I am using it in if()
  condition in takes it as a false.</p>
  
  <p>Code:</p>
  
  <pre><code>if(best.test(password))              //It takes it as a false .
  {
      document.write(best.test(password));
      tdPwdStrength.innerHTML="best"+best.test(password);  //but in actual it is true and returning true. 
  }                                                     
  </code></pre>
  
  <p>Please Suggest!</p>