What are the basic data types of Js
This article introduces the relevant knowledge of "what are the basic data types of Js". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
There are six data types String in js: string Number: numeric Boolean: Boolean Null: null Undefined: undefined Object: object; where String,Number,Boolean,Null,Undefined belongs to the basic data type and Object belongs to the reference data type.
What does the data type mean?
The data type refers to the literal type.
Six basic data types of Js
String string
-using strings in js requires quotation marks
-double quotation marks or single quotation marks can be used, but not mixed
-quotation marks cannot be nested
Number numerical type
All numeric types in js are Number
Including integers and floating point numbers
You can use one operator, typeof.
-check variable types
Syntax:
Typeof variable
String is returned when checking the string
Number is returned when the value is checked
Number.MAX_VALUE, the maximum value that can represent a numeric value in js
Boolean Boolean type
Boolean: Boolean valu
There are only two Boolean values, which are mainly used for logical judgment.
True
-means true.
False
-indicates false
Checking a Boolean value with typeof returns a boolean
Null (null)
The value of the Null (null) type is only one null
The value null is specifically used to represent an empty object.
When a null is checked with typeof, object is returned.
Undefind (undefined)
There is only one value for Undefind (undefined) type, which is undefind
When you declare a variable without assigning a value to it, it is Undefind.
This is the end of the content of "what are the basic data types of Js". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!