var a = function(){ this.b =1; } var get = new a(); console.log(get.b); 函数是一种特殊对象,实例化一下就行了,js的私有变量 方法不成体系,所以写法比较绕。