javascript如何利用方法获取当前对象是number
、string
、boolean
等。下面web建站小编给大家详细介绍一下代码!
实例代码如下:
console.log( typeof '1234' ); //检测数字1234,结果为:string console.log( typeof 1 ); //检测数字1,结果为:number console.log( typeof true ); //检测true,结果为:boolean console.log( typeof false ); //检测false,结果为:boolean console.log( typeof undefined ); //检测undefined,结果为:undefined console.log( typeof null ); //检测null,结果为:object console.log( typeof {} ); // 检测对象,结果为:object console.log( typeof [] ); //检测数组,结果为:objec
jquery如何判断某个元素是否存在(判断元素是否存在某个属性)
标签: typeof
上面是“js如何获取当前对象的类型(number/string/boolean)”的全面内容,想了解更多关于 js 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2730.html
workflows工作流
一辆停在混凝土墙前运动型SUV捷豹概念车
一棵白色心形流苏树comfyui工作流
树上挂着一只快乐的荔枝ComfyUI工作流
一个外国人在吹奏萨克斯ComfyUI工作流
一个港口配备了小型船只、起重机、集装箱和码头
一幅梦幻家园comfyui工作流
泰坦尼克号桌面壁纸上ComfyUI工作流
一只在森林里漫步的麋鹿ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!