Home > Article > Web Front-end > Does javascript have data types?
JavaScript has data types, which are: 1. Primitive data types, object, number, string, boolean, null and undefined; 2. Reference data types, Array, Date and function of object type.
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
Javascript's data types are divided into two categories: original data types and reference data types
Original data type:
Object
## NumberString
# Boolean
NULL
## Undefined## 引 The data type:
Object type Array, Date, Function
js variables
[1] Declaration of variables in js
v variable name = value;
## [2] The use of variables in js pay attention to pay attention to The names of the variables in # A, JS are consistent with the naming of Java's bidders. B, JS variable names can be repeated, but the name of the latter will cover the name of the former # C and JS. It is not recommended that you write this way. Commonly used type detection methods are: typeof, instanceof Liezi:var age = 13; alert(typeof(age)); //浏览器弹框内容:number var name = '五宝'; alert(typeof(age)); //浏览器弹框内容:string 注意,JavaScript没有char类型
76c82f278ac045591c9159d381de2c57 100db36a723c770d327fc0aef2ce13b1 93f0f5c25f18dab9d176bd4f6de5d30e 4d0d87937f6c83b675e896c64d3eb7c9 b2386ffb911b14667cb8f0f91ea547a76e916e0f7d1e588d4f442bf645aedb2f 3f1c4e4b6b16bbbd69b2ee476dc4f83a var a =1; var b =null; var c ="你好"; var d=true; var e=new Date(); var f='5'; var z=1.32; var a=123; alert(typeof(e)); //浏览器弹框出现 object 2cacc6d41bbb37262a98f745aa00fbf0 9c3bca370b5104690d9ef395f2c5f8d1 6c04bd5ca3fcae76e30b72ad730ca86d 36cc49f0c466276486e50c850b7e4956 73a6ac4ed44ffec12cee46588e518a5e[Recommended learning:
javascript advanced tutorial]
The above is the detailed content of Does javascript have data types?. For more information, please follow other related articles on the PHP Chinese website!