When coding a library in JavaScript, what is the most standard (friendly?) Way to handle invalid function input? My gut tells me that returning undefined is fine, but is it really useful to make a mistake instead? Or does it really not matter?
I could also see a return of false, null, or even -1, but I don't think they will be as widely expected.
(If this question is too subjective, I'm glad to make it cw.)
source share