Chinaunix首页 | 论坛 | 博客
  • 博客访问: 17609
  • 博文数量: 4
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 39
  • 用 户 组: 普通用户
  • 注册时间: 2014-10-13 11:19
个人简介

Linux,mail,web开发人员

文章分类

全部博文(4)

文章存档

2016年(1)

2015年(3)

我的朋友
最近访客

分类: JavaScript

2015-03-01 10:10:55


点击(此处)折叠或打开

  1. var a={};
  2.     a.a=1;
  3.     a.b="ccc";
  4.     a.c=new Date();
  5.     a.d={};
  6.     a.e=1.23;
  7.     a.f=[];
  8.     a.h=null;
  9.     a.i=undefined;
  10.     var i;
  11.     for(i in a){
  12.         console.log("typeof "+i+" is: "+typeof(a[i])+" "+Object.prototype.toString.call(a[i]));
  13.     }


输出

typeof a is: number            [object Number]
typeof b is: string               [object String]
typeof c is: object               [object Date]
typeof d is: object               [object Object]
typeof e is: number            [object Number]
typeof f is: object                [object Array]
typeof g is: function            [object Function]
typeof h is: object               [object Null]
typeof i is: undefined          [object Undefined]


阅读(651) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:linux 下哪些函数反返回文件描述符

给主人留下些什么吧!~~