JavaScript syntax: Difference between revisions

Content deleted Content added
Nelsonkam (talk | contribs)
Undefined: Improved formatting for better rendering on mobile version.
Tags: Mobile edit Mobile web edit
Nelsonkam (talk | contribs)
Null: Improved formatting for better rendering on mobile version.
Tags: Mobile edit Mobile web edit
Line 163:
Unlike undefined, [[Null Object pattern|null]] is often set to indicate that something has been declared, but has been defined to be empty. In a Boolean context, the value of null is considered a false value in JavaScript.
 
Note: Null is a true primitive-type within the JavaScript language, of which <tt>{{mono|null</tt>}} (note case) is the single value. As such, when performing checks that enforce type checking, the null value will not equal other false types. Surprisingly, <tt>{{mono|null</tt>}} is considered an object by <tt>{{mono|typeof</tt>}}.
 
<syntaxhighlight lang=JavaScript>