I'm not sure I fully understand what you mean here, but to improve the defensive coding of your program I would suggest breaking stuff down into small to manage functions and then thinking about the edge cases and potential problems those functions may face (e.g. wrong inputs, missing inputs, etc) and add some code to defend against those cases. Similarly to how I show the progression of a normal multiply function and then adding code to handle edge cases.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Now, how can I integrate this into my TS/JS projects, because of not-so-true static typing, and any casting...
I'm not sure I fully understand what you mean here, but to improve the defensive coding of your program I would suggest breaking stuff down into small to manage functions and then thinking about the edge cases and potential problems those functions may face (e.g. wrong inputs, missing inputs, etc) and add some code to defend against those cases. Similarly to how I show the progression of a normal multiply function and then adding code to handle edge cases.