Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Javascript subclasses

Tags:

javascript

How can I find all subclasses (both immediate, as well as all descendants) of a given Javascript "class"? Note that Prototype (v1.6.0) supports this with "subclasses", but I am wondering about plain Javascript.

like image 763
Lo HaBuyshan Avatar asked Jul 28 '26 01:07

Lo HaBuyshan


1 Answers

JavaScript (at least ES5 and below) has no concept of classes, it only knows prototypes, which have no idea who used them as "super" or "sub" construction. The Prototype library only knows these relations when you exclusively use its own class model on top of plain JS, simply tracking it as part of its extension API.

like image 175
Mike 'Pomax' Kamermans Avatar answered Jul 29 '26 14:07

Mike 'Pomax' Kamermans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!