We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bb1744 commit 13be54eCopy full SHA for 13be54e
OOPS/9.2StaticFunctionAndNormalFunction.js
@@ -0,0 +1,18 @@
1
+class config{
2
+ static a1={
3
+ 1:'hello'
4
+ };
5
+ //using this keyword for accessing a static property inside a static method
6
+ static show(){
7
+ console.log('static show');
8
+ console.log(this.a1);
9
+ }
10
+ //accessing a static function inside a normal fuction
11
+ display(){
12
+ console.log('display show 1');
13
+ config.show();
14
15
+}
16
+config.show(); //calling static fx
17
+const a=new config(); //calling normal function
18
+a.display();
0 commit comments