title: Why "access denied" always alerts
body: <p>I have a code that checks if you are 18 years old:</p>
  <pre><code>let age = prompt(&quot;How old are you?&quot;)
  
  function chk(age) {
    age = (age &gt; 18) ? alert(&quot;Access allowed&quot;) : alert(&quot;Access denied&quot;);
  }
  chk()
  if (age &lt; 18) {
    let c = confirm(&quot;Are your parent allowed?&quot;);
    if (c) {
      alert(&quot;ok&quot;)
    } else {
      alert(&quot;than bye&quot;)
    }
  } else {
    alert(&quot;Bye&quot;)
  }
  </code></pre>
  <p>But for some reason, access always denied. Why?</p>