📜  私有类成员 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:45.181000             🧑  作者: Mango

代码示例1
class Person {
    constructor(name) {
        var _name = name
        this.setName = function(name) { _name = name; }
        this.getName = function() { return _name; }
    }
}