We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec830de commit 0ad6b4eCopy full SHA for 0ad6b4e
docs/class.md
@@ -876,7 +876,7 @@ Foo.classMethod() // 'hello'
876
877
var foo = new Foo();
878
foo.classMethod()
879
-// TypeError: undefined is not a function
+// TypeError: foo.classMethod is not a function
880
```
881
882
上面代码中,`Foo`类的`classMethod`方法前有`static`关键字,表明该方法是一个静态方法,可以直接在`Foo`类上调用(`Foo.classMethod()`),而不是在`Foo`类的实例上调用。如果在实例上调用静态方法,会抛出一个错误,表示不存在该方法。
0 commit comments