Home  >  Article  >  Web Front-end  >  What does null mean in js?

What does null mean in js?

little bottle
little bottleOriginal
2019-05-17 09:29:066180browse

There are two primitive types in JavaScript: Null and Undefined. These two types often cause confusion among JavaScript developers. What do Null and Undefined mean respectively?

What does null mean in js?

#The Null type has only one value, null. Null is used to represent an object that does not yet exist. It is often used to indicate that a function attempts to return a non-existent object.

The Undefined type also has only one value, which is undefined. When a declared variable has not been initialized, the variable's default value is undefined.

The above is the detailed content of What does null mean in js?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn