What does the null of JavaScript mean
This article mainly introduces the relevant knowledge of what JavaScript null represents, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this JavaScript null article. Let's take a look at it.
Null means "nothing" in JavaScript by null.
Null is a special type that has only one value. Represents an empty object reference.
Note detects null with typeof and returns object.
You can set it to null to clear the object:
Example
Var person = null; / / value is null (empty), but the type is object
You can set it to undefined to clear the object:
Example
Var person = undefined; / / value is undefined, type is undefined
Undefined
In JavaScript, undefined is a variable with no set value.
Typeof A variable with no value returns undefined.
Example
Var person; / / value is undefined (empty), type is undefined
Any variable can be cleared by setting the value to undefined. Type is undefined.
Example
Person = undefined; / / value is undefined, type is undefined
This is the end of the article on "what does the null of JavaScript mean?" Thank you for reading! I believe you all have a certain understanding of the knowledge of "what JavaScript null means". If you want to learn more knowledge, you are welcome to follow the industry information channel.