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 16 '25
Right, so you can add methods to your "classes" via the prototypes. Like swift extensions do.
I had to google it because swift syntax is weird af.
You add your method to the prototypes you wish to modify, and it immediately becomes available globally. Even in objects that already exist. That's it.
What part of this is verbose? I don't understand.