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 阅读(314) 评论(1) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 _TANGTANG Powered by .NET 8.0 on Kubernetes