jQuery check for empty variable
<p>So, I have the following js markup:</p>

<pre><code>jQuery(document).on( 'click', '.rhpcon', function(e) {  
    var rhp_name = jQuery(this).find('.rhi').data("name");

    var my_html = '&lt;div class="rhfi"&gt;'+ rhp_name +'&lt;/div&gt;'; 
        my_html += '&lt;div class="something"&gt;Show something else&lt;/div&gt;';                          
    jQuery('.rh_pop').html(my_html);                        
});
</code></pre>

<p>As you can see, the <code>rhp_name</code> variable is used in the hardcoded html.</p>

<p>However, there are scenarios where <code>data-name</code> does not exist (ie, no <code>rhp_name</code> variable).</p>

<p>In a scenario where there is no <code>rhp_name</code> variable, I don't want the first <code>my_html</code> line to be used. </p>

<p>How do I check if the <code>var</code> is empty and so on?</p>

<p>Thanks!</p>