function hofFuncArgs(func, arg1, arg2, arg3) {
        var func_args = [arg1]; // the first arg (the value) is required
        // the other two are optional - only supply it if the function can take it
        var length = getFunctionArity(func);
        if (length >= 2) {
            func_args.push(arg2);
        }
        if (length >= 3) {
            func_args.push(arg3);
        }
        return func_args;
    }
Helper function to build the arguments to be supplied to the function arg of the
HOFs map, filter, each, sift and single
@param {function} func - the function to be invoked
@param {*} arg1 - the first (required) arg - the value
@param {*} arg2 - the second (optional) arg - the position (index or key)
@param {*} arg3 - the third (optional) arg - the whole structure (array or object)
@returns {*[]} the argument list