source: node_modules/es-toolkit/dist/array/sample.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 138 bytes
Line 
1function sample(arr) {
2 const randomIndex = Math.floor(Math.random() * arr.length);
3 return arr[randomIndex];
4}
5
6export { sample };
Note: See TracBrowser for help on using the repository browser.