JS 基本数据类型
- boolean
let c = true
console.log(typeof c) //boolean
- number
let a = 123
console.log(typeof a) //number
- string
let a = '123'
console.log(typeof a ) //string
- undefined
let a
console.log(typeof a) //undefined
console.log(typeof b) //undefined
- null
let a = null
console.log(typeof a) //object
- symbol
let a = Symbol()
console.log(typeof a) //symbol
JS 复杂数据类型
- object
let a = {name: 'roy'}
console.log(typeof(a)) //object
let a = ['apple']
console.log(typeof a) //object
网友评论