static arrayTrim(array, length) {
        const arrLength = array.length;
        if (arrLength === 0 || length > arrLength) {
            // Also manage the case where `length` is higher than the current length
            return array;
        }

        if (length < 0) {
            return [];
        }

        array.length = parseInt(length, 10);

        return array;
    }
Return the given array trimmed to the given length.
@example arrayTrim([1, 2, 3, 4], 2) -> [1, 2]

@param {Array} array
@param {Number} length
@returns {*}