Somtimes I was passing single DOM elements, but other times I was passing a list of them either as an Array or as an HTMLCollection. Two usages were as follows:
This worked great for a while, but apparently the powers-that-be decided the storage class HTMLCollection just wasn't cutting it and calls to getElementsByName one day started returning a new data type: NodeList, which of course broke my script.
So my questions are:
1) Should I just be abandoning this technique of interrogating argument types to achieve what is basically a function overload? Should I instead restrict myself to having two methods: hide() and hideList() (which seems rather cumbersome given my background)?
2) Or is there some more robust way I could have written my original hide method such that it wouldn't have failed and that is in general a better way to achieve function overloading?