How can I set a javascript variable to "" if it is undefined?
<p>I have the following:</p>

<pre><code>var viewID = $(link).data('dialog-id')
</code></pre>

<p>This works when there is a dialog-id value. But when there is no value then viewID gets the value of "undefined". </p>

<p>Is there a way that I can make the value of viewID be equal to an empty string if dialog-id is not available or be equal to dialog-id if it is available?</p>
