📌  相关文章
📜  JS如何访问类属性 - Javascript代码示例

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

代码示例1
function Penguin(name){

   this.name=name;

   this.numLegs=2;

}

var emperor = new Penguin("emperor");

console.log(emperor.name);
console.log(emperor.numLegs);