UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

16 lines (11 loc) 335 B
'use strict'; /*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ // src/generateSampleArray.ts function generateSample(arr, count) { return Array.from({ length: count }, (_) => arr[Math.round(Math.random() * (arr.length - 1))]); } exports.generateSample = generateSample;