.data() inconsistent return value
The .data() function returns inconsistent values:
If you try to load a not-existing-value of an object, which does not have ANY values stored, it will return null.
But if this object has ANY value stored in it, and you load the not-existing-value, it returns "undefined".
Example:
- <div id="div1">test</div>
- <script type="text/javascript">
console.log($("#div1").data("test")); // -> result: null
- $("#div1").data("abcdefg", 1);
- console.log($("#div1").data("test")); // -> result: 'undefined'
- </script>
That's not what it should be like, is it?