六大数据类型

JS中的数据类型:

数字类型(数字,NaN)
字符串类型
布尔值类型(true,false)
函数类型
对象类型(obj、[]、{}、null)
未定义类型(undefined)

判断数据类型:typeof()

1.typeof返回的一律是字符串类型!
2.typeof只会返回上述六种类型,加一种ES6提供的新类型:
‘number’, ‘boolean’, ‘string’, ‘undefined’, ‘object’, ‘function’,‘symbol’

数据类型转换:Number() parseInt() parseFloat()

猜你喜欢

转载自blog.csdn.net/yijun9588/article/details/88395594