【前端学习】—JS判断数据类型的方式有哪些(八)

一、JS中判断数据类型的场景

二、JS中有哪些数据类型

三、JS判断数据类型的方式有哪些


const arr=[];
const object={};const number=1;
const string='string';//typeofconst type=typeof arr;
console.log(`type`,type);//type objectconst type1=Object.prototype.toString.call(object);console.log(type1);//[object Object]const type11=typeof number;
console.log(type11);//number