• Flatten an Arguments array. In this context, it means that if the array only contains one element, and that element is an Array, it will be returned instead of the outer Array.

    Parameters

    • args: any[]

      Arguments array. Must be some array-like object.

    Returns any[]

    Flattened argument array

    This method had been deprecated with the following justification, however, Node.JS is not handling well calling Java functions with variadic arguments, so this is still necessary.

    "This is implemented for compatibility reasons. As the Lara language used ES5 as its base, there was no spread operator to pass argument arrays to variadic functions, so there is calling code expecting to be able to pass a single array as the variadic argument."