what is items here?
items
@shivamblog Sorry items could be the number of items so you can shuffle and also get only some of them:
and the array should be the array to shuffle and slice it.
const randomizeArray = () => [...array].sort(() => 0.5 - Math.random()).slice(0, numberOfItems);
Then it is correct!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
what is
itemshere?@shivamblog Sorry items could be the number of items so you can shuffle and also get only some of them:
and the array should be the array to shuffle and slice it.
Then it is correct!