Content deleted Content added
Undid revision 848602152 by 202.89.42.244 (talk) |
|||
Line 172:
<syntaxhighlight lang="javascript">
var test; // variable declared, but not defined, ...
// ... set to value of undefined
var testObj = {};
console.log(test); // test variable exists, but value not ...
// ... defined, displays undefined
console.log(testObj.myProp); // testObj exists, property does not, ...
// ... displays undefined
console.log(undefined == null); // unenforced type during check, displays true
console.log(undefined === null); // enforce type during check, displays false
</syntaxhighlight>
|