title: IF block inside render function ReactJS
body: <p>Am newbie to ReactJS. I want to use a IF block inside the render function. While search for this I got result like "You should use ternary operator instead of IF statement". But if I want to use something like,</p>
  
  <pre><code>$.each(array, function(i, x) {
    var flag = 0
    if({x.a1} || !{x.a2}) {
      flag = 1;
      &lt;p&gt;true flag enabled&lt;/p&gt;
    }
    &lt;p&gt;...&lt;/p&gt;
   });
  </code></pre>
  
  <p>How to convert this statement into JSX syntax or how to use it in React <em>render</em> fucntion.</p>
  
  <p>Thanks in advance.</p>