javascript 公有私有,oop

来源:互联网 发布:军用bkt开山刀数据 编辑:程序博客网 时间:2024/05/11 10:01
function Person(name, age) {this.name = name;        this.age = age;        var bankInfo = "12342432";        this.getBankInfo = function() {                 return this.bankInfo;        }}

this.name,this.age is public property

bankInfo is private property

0 0
原创粉丝点击