2 ms·
About 15 years ago it was good practice in JavaScript to check the function parameters to make sure the caller didn't do anything wrong, which would throw a fri
by z3t4 8y ago
About 15 years ago it was good practice in JavaScript to check the function parameters to make sure the caller didn't do anything wrong, which would throw a friendly error message to the developer. But this seem to be thrown upon by new developers, they argue that it's "code clutter". This "code clutter" however solves almost all problems with the dynamic nature of JavaScript. Also type annotations and static typing do not substitute good documentation, nor does it substitute testing.