var Person = function(name) {
this.name = name;
this.gender = ['man', 'woman'];
}
console.log(Person);
console.dir(Person);
console.dir(JSON.stringify(Person));
console.log(typeof(Person));
console.log(Person.toString());

  

上面打印的结果:

[Function: Person]
[Function: Person]
undefined
function
function (name) {
   this.name = name;
   this.gender = ['man', 'woman'];
}

  

可以采用toString()的方式对函数进行打印。

 

posted on 2018-05-22 11:53  Boom__Clap  阅读(884)  评论(0编辑  收藏  举报