I am a newbie with JavaScript and I feel the unresistible need to strong type my functions parameters for a couple of tools I am coding:
- That would give me autocompletion within those functions
- Debugging/function access gets more consistent
After some googling, I guess this isn’t directly possible. However, are there common tools to emulate this rather simply?
What are your thoughts?
No, you can’t and even if there is a way you shouldn’t. JavaScript is a dynamically typed language. For auto completion you can however use JSDoc style documentation tags that give some type pointers:
If they are being used depends entirely on your IDE though.