What can this access in class with JavaScript

1 Answer

0 votes
class Test {
  constructor() {
    const prototype_of_this = Object.getPrototypeOf(this);
    console.log(Object.getOwnPropertyNames(prototype_of_this));
  }
  f1(){}
  f2(){}
  f3(){}
  static f4(){}
}

new Test(); 




/*
run:

[
"constructor" ,
"f1" ,
"f2" ,
"f3"
] 

*/

 



answered Nov 20, 2020 by avibootz

Related questions

1 answer 155 views
1 answer 175 views
1 answer 164 views
1 answer 85 views
85 views asked Feb 4, 2023 by avibootz
2 answers 196 views
196 views asked Jul 5, 2017 by avibootz
1 answer 273 views
1 answer 191 views
...