title: How do string comparison operators work in Twig?
body: <p>How is this possible? It seems to be a very very odd issue (unless I’m missing something very simple):</p>
  
  <p>Code:</p>
  
  <pre class="lang-html prettyprint-override"><code>{{ dump(nav) }}
  {% if nav == "top" %}
      &lt;div class="well"&gt;This would be the nav&lt;/div&gt;
  {% endif %}
  </code></pre>
  
  <p>Output:</p>
  
  <pre class="lang-html prettyprint-override"><code>boolean true
  &lt;div class="well"&gt;This would be the nav&lt;/div&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/jLTQy.png" alt="Screenshot"></p>
  
  <p>Basically, it is outputting if true, but it’s not meant to be checking for true.</p>