Else statement does not get executed in Javascript : <p>Hello I've been trying to write a function to validate a string value. My code is below</p>

<pre><code>function verifyPassword(){
passW = prompt ("Password:");

if (passW = 'Pass123'){
  document.write ('Your password is correct');
}
else {

  document.write ('Your password is incorrect');
}
}

verifyPassword();
</code></pre>

<p>But here I always seem to get the result as 'Your password is correct', no matter what I put. </p>

<p>Please can someone help me to resolve this issue?</p>
