Test for Missing .data() Result
<p>How would I read the value of a data attribute and check if the attribute doesn't exist?</p>

<p>For example:</p>

<pre><code>var value = $(selector).data('myData');
</code></pre>

<p>What's the most reliable way to check if the <code>data-myData</code> attribute was missing or contains no data? If it's missing and I do `value.length' then I'll get an error.</p>

<p>I know I can use <code>hasData()</code> but, if the data is there, I need it and it seems less efficient to check the value twice.</p>
