title: How to compare a value in handlebars?
body: <p>I want display different HTML depending on a condition.</p>
  
  <p>It doesn't seem to compare those two values and it always shows the first variant. How can I compare the predefined values to the original value from JSON so that it can execute properly?</p>
  
  <pre><code>{{#each this}}
    {{#each visits}}
      &lt;div class="row"&gt;
        {{#if variable_from_json }}
          &lt;div class="col-lg-2 col-md-2 col-sm-2"&gt;
            &lt;i class="fa fa-home"&gt;&lt;/i&gt;
           &lt;/div&gt;
        {{else}}
          &lt;div class="col-lg-2 col-md-2 col-sm-2"&gt;
            &lt;i class="fa fa-plus symbol-hospital"&gt;&lt;/i&gt;
          &lt;/div&gt;
        {{/if}}
      &lt;/div&gt;
    {{/each}}
  {{/each}}
  </code></pre>
  
  <p>JS code</p>
  
  <pre><code>Handlebars.registerHelper('if', function (variable_from_json, options) {
      if (variable_from_json === "M") {
          return options.fn(this);
      } else {
          return options.inverse(this);
      }
  });
  </code></pre>