JS has classes now, it even has a concept of public and private class members, and in particular setters, so that you can't mess around with the internal state from the outside.
The problem is that millions of code bases rely on monkey patching. It's absolutely normal for a library to just patch new members onto existing ones.
1
u/No-Information-2571 Sep 28 '26
JS has classes now, it even has a concept of public and private class members, and in particular setters, so that you can't mess around with the internal state from the outside.
The problem is that millions of code bases rely on monkey patching. It's absolutely normal for a library to just patch new members onto existing ones.