I saw I could return different types from the same function in JavaScript. Is this practice idiomatic or should it be discouraged?
For example:
somef
it is very common that one function return different types of object in javascript, just write it, invoke it and determine the type of return value.