'' equals false in Javascript? What would be the safest way to distinguish between '' and boolean false?
<p>We use an external API whcih returns '' or boolean false while Javascript seems to find the both equal.
for example:</p>

<pre><code>var x = '';
if (!x) {
  alert(x); // the alert box is shown - empty

}
if (x=='') {
  alert(x); // the alert box is shown here too  - empty

}
var z = false;
if (!z) {
  alert(z); // the alert box is shown - displays 'false'

}
if (z=='') {
  alert(z); // the alert box is shown here too - displays 'false'

}
</code></pre>

<p>How can we distinguish between the two? </p>
