Hello. I study programming and javaScript.
I break a large function into small ones. There was a difficulty with checking the arguments.
Unclear questions like:
- Is the calling or called function responsible for what types of arguments and their number match the expected ones?
- When to check arguments and when can I omit it?
- How to validate types?
- etc.
The natural question has ripened: are there any generally accepted (or not generally accepted) agreements to this effect?