Get the App
SLTechnology News&Howtos  ›  Development  › 

What does the null of JavaScript mean

Shulou Source: shulou.com Published: 2022-06-01 10:54:42 10月13日 Update

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.

Tags: Type instance object variable knowledge content article special value only can be passed easy to operate article easy to understand more look industry information channel channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL MariaDB Apple macOS