title: How to set null to a variable in freemarker
body: <p>I can't find anything related to this on any question, and it is something really basic, but I can't figure it out.</p>
  
  <p>So my problem is that I don't know how to set null to a variable in freemarker.
  Example:</p>
  
  <pre><code>${hi!"bye"}          &lt;#-- Prints "bye" because hi is undefined --&gt;
  &lt;#assign hi="hi"&gt;    &lt;#-- Sets a value to the var hi --&gt;
  ${hi!"bye"}          &lt;#-- Prints "hi" because hi has a value --&gt;
  &lt;#assign hi=null&gt;    &lt;#-- This does not work but is what I am looking for --&gt;
  ${hi!"bye"}          &lt;#-- I want it to print "bye" because hi should be undefined --&gt;
  </code></pre>
  
  <p>I have this problem because I iterate over a list and set a var if some logic to the specific item validates, and then check if the var exists, but if the first item creates the var, then I will have the var set for the rest of the items in the list.</p>