How to use if condition in ejs template
<p><strong>Server Code</strong></p>

<pre><code>Details['11'] = {
            'id': '11',
            'name': 'Avanish'
        };
res.render('/index',{'Message': Details});
</code></pre>

<p><strong>Page code</strong></p>

<pre><code>        &lt;script&gt;
           var ERRORCONST = 'Error';
           var NORECORDS = 'No records';
        &lt;/script&gt;

&lt;%if(Message != undefined &amp;&amp; Message != NORECORDS &amp;&amp; Message != ERRORCONST ){%&gt;
&lt;%Message.forEach(function(key){%&gt;
&lt;span&gt;&lt;%= key.id %&gt; - &lt;%= key.name %&gt;&lt;/span&gt;
&lt;%});%&gt;
&lt;%}%&gt;
</code></pre>

<p>Getting error <code>NORECORDS is not defined</code>and print all code on page.
I have two error. One is how to use Multiple condition in single if statement and second is how to compare <code>javascript</code> varibale with server variable</p>