UNPKG

@devlander/utils

Version:

Comprehensive JavaScript and TypeScript utilities for seamless development. Includes object manipulation, data validation, and more.

8 lines (7 loc) 352 B
/** * Fetches a random value from the provided array. * @param arr - The array to select a random value from. * @param fallbackValue - A fallback value to return if the array is empty or undefined. * @returns A random value from the array or the fallback value. */ export declare const getRandomValFromArray: <T>(arr: T[], fallbackValue: T) => T;