When coding a library in JavaScript, what is the most standard (friendliest?) way to handle invalid input to a function? My gut tells me that returning undefined is perfectl
maybe obvious If you extending an environment - continue their practice as a minimum
Quick answer. If this is javascript in the browser undefined is OK, if it is javascript in the server throw an error.
Improved Let the library user select the behavior as an option, either library global, or on an object by object basis.