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 236 views
1 answer 271 views
1 answer 247 views
1 answer 272 views
1 answer 167 views
167 views asked Feb 4, 2023 by avibootz
2 answers 306 views
306 views asked Jul 5, 2017 by avibootz
1 answer 356 views
...