function Person(name,age){
//私有变量
var _name=name;
function _eat(){
console.log("eatting...")
}
//公有变量
this.age=age;
this.sayName=function(){
console.log(_name);
}
}
var p1=new Person("nicole",24);
posted on
2016-09-12 12:08_TANGTANG
阅读(318)
评论(1)
收藏举报