title: How can 'const' have an influence on the type of the variable?
body: <p>I've had this little problem where I wanted to check all checkboxes inside a specific area with the help of some javascript and a few jquery functions. I retrieved the value of the "select-all" checkbox and wanted to check/uncheck all other checkboxes under it.</p>
  
  <p>Case 1: <code>status = (elt.checked == true);</code>
  This gives me a string with the value <code>"true"</code> or <code>"false"</code> which, when put into a conditional statement, will always be seen as <code>true</code> since it's not an empty string.</p>
  
  <p>Case 2: <code>const status = (elt.checked == true);</code>
  This gives me a boolean with the value <code>true</code> or <code>false</code> which can actually be used in the conditional statement.</p>
  
  <pre><code>$(document).on('change', '.select-all input', function(e) {
      elt = e.target;
      status = (elt.checked == true);
      $(elt).closest('.files-list').find('input').each(function(i, e) {
          if (status)
              $(e).attr('checked', true);
          else
              $(e).removeAttr('checked');
      });
  });
  </code></pre>
  
  <p>Why does this <code>const</code> modifier have any influence on the data type of the variable?</p>