Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js how to shufle elements in array

const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const shuffledArray = array.sort((a, b) => Math.random() - 0.5);
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #js #shufle #elements #array
ADD COMMENT
Topic
Name
8+7 =