Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

node 类中字段和方法名不能一样?

$
0
0

node 类中字段和方法名不能一样?

class A {
    constructor(){
        this.aa = 123;
    }
    
    aa() {
        console.log(this.aa)
    }
}
new A().aa();  //  (intermediate value).aa is not a function

Viewing all articles
Browse latest Browse all 14821

Trending Articles