I've implemented multiple functions structured like this:
this.something = function (which) {
// Can be one or many.
if (!Array.isArray(which)) {
// Single input case.
doSomething(which);
} else {
// Multiple inputs case.
which.forEach(function (thing) {
// Utilizing recursion
something(thing);
});
}
};
Any suggestions for a more concise approach?