The code below works for a normal array but not with an array with object does anybody knows how to do this?
Here is one more example based on lodash _.shuffle.
const array = [ { some: 1 }, { some: 2 }, { some: 3 }, { some: 4 }, { some: 5 }, { some: 6 }, { some: 7 }, ]; console.log(_.shuffle(array));