JS中的数据类型:String,Number(含NaN),Boolean,BigInt,Symbol,undefined,Object。其中Object数据类型又包含普通Object对象和特殊Object对象(null,function,Array,Math,正则表达式等)
console.log(typeof '1','---------') //string ---------
console.log(typeof(1),'其中NaN的类型为',typeof (NaN),'---------') //number 其中NaN的类型为 number ---------
console.log(typeof(1n),'1111111111111111111111111的4次方的值为:',1111111111111111111111111n**4n,'---------') //bigint 1111111111111111111111111的4次方的值为: 1524157902758725803993293095564700502972107910379606767261088248742569730217954580094497789971041n ---------
console.log(typeof(Symbol(1)),'---------') //symbol ---------
console.log(typeof(true),'---------') //boolean ---------
console.log(typeof(undefined),'---------') //undefined ---------
console.log(typeof({}),typeof (/1/),typeof (null),typeof (Math),typeof ([]),typeof (function () {}),'---------') //object object object object object function ---------
//在JS中,函数也是对象的一种,如果你觉得这样归类不符合习惯,你也可以自行归类,合理就行,比如你可以称呼它为第8中数据类型,叫函数类型。