1 JavaScript区分大小写
2JavaScript注释方式
2.1 // 单行注释
2.2 /* 多行注释 */
3数据类型
原始数据类型
String(字符串)
Number(数字)
Boolean(布尔值)
Null(空)
Undefined(未定义)
引用数据类型:
Object
Array
Function
通过 typeof 可以知道当前数据所处类型。
typeof 123 //Number
typeof 'abc' //String
typeof true //Boolean
typeof undefined //Undefined
typeof null //Object
typeof { } //Object
typeof [ ] //Object
typeof console.log() //Function
null类型进行 typeof 操作符后,结果是object,原因在于,null类型被当做一个空对象引用。
4 类型转换
网址:https://blog.csdn.net/qq_37746973/article/details/82491282
https://www.cnblogs.com/solaZhan/p/12163033.html
显示转换
- 转换为数值类型:Number(mix)、parseInt(string,radix)、parseFloat(string)
- 转换为字符串类型:toString(radix)、String(mix)
- 转换为布尔类型:Boolean(mix)
隐式转换
Javascript也会进行自动类型转换
具体查看上方网址