These are the following data base in java script.
Note: typeof operator will tell you what it is, whether it is function, object or string etc.,
- Number - Integer and floating point can mentioned here.
- String - For String, may have one or more characters.
- Boolean - True or false value can be mentioned here.
- Null - For unknown values null.
- Undefined - For unassigned value
- Object - For making data structure
- Symbol - For unique identifiers.
Example:
Below example explain all data types with the help of typeof operator,
typeof undefined // undefined typeof 0 // number typeof true // boolean typeof "foo" // string typeof Symbol("id") // symbol typeof null // object typeof alert // function
Note: typeof operator will tell you what it is, whether it is function, object or string etc.,
No comments:
Post a Comment