Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get random elements from array javascript

array.sort(() => Math.random() - Math.random()).slice(0, n)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #random #elements #array #javascript
ADD COMMENT
Topic
Name
7+7 =