Does null stand for 0 in javascript?
This article mainly introduces the relevant knowledge of whether null represents 0 in javascript, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe that after reading this javascript, null represents 0 article will have something to gain, let's take a look.
Null in JavaScript does not represent 0, only in basic mathematical operations, the null value will be converted to 0. Null in JavaScript represents "nothing", null is a special type with only one value, and 0 is a numeric type, which means the number "0".
The operating environment of this tutorial: windows10 system, javascript1.8.5 version, Dell G3 computer.
Does null stand for 0 in javascript?
In JavaScript, null means "nothing".
Null is a special type that has only one value. Represents an empty object reference.
A null value represents a reference to an object or address that does not exist or is not valid. Even if it points to something that doesn't exist, it doesn't matter, it's a global object (and one of the original values of JavaScript).
A negative null value returns true, but comparing it with false (or true) gives false.
In basic mathematical operations, null values will be converted to 0
0 is a number, which represents the number 0.
Number:
There are two forms of representation of this type, the first is an integer and the second is a floating point number. Integers: can be represented by decimal, octal, and hexadecimal literal values. Floating point: this value must contain a decimal point and must be followed by a decimal point.
This is the end of the article on "whether null stands for 0 in javascript". Thank you for reading! I believe you all have a certain understanding of the knowledge of "whether null stands for 0 in javascript". If you want to learn more, you are welcome to follow the industry information channel.