r/programminghorror
•
u/Leonnee
•
Jun 12 '25
•
1
Javascript Javascript is filled with horror
2.4k
Upvotes
View all comments
Show parent comment
1
u/LordFokas Jun 18 '25
1 & 2 don't apply because JS doesn't have types in the sense of class hierarchy. The types are number, string, boolean, symbol, and object. Symbol is special, ignore it.
3 is just duck typing. If it has the methods, it implements the protocol. Types don't matter.
4 has always been a thing but it's a bit weird in JS. TypeScript makes it easier to handle. And yes, constructors is right.