I am trying to shuffle an array of objects using an shuffle npm module (https://www.npmjs.com/package/shuffle-array) - However I am getting errors like 'ypeError: Object(...) is not a function'.
let posts = [
{
postUrl: "https://www.linkedin.com/1",
action: "Post",
profileUrl: "https://www.linkedin.com/company/1",
timestamp: "2019-10-09T09:40:05.356Z"
},
{
postUrl: "https://www.linkedin.com/2",
action: "Post",
profileUrl: "https://www.linkedin.com/company/2",
timestamp: "2019-10-09T09:40:05.356Z"
},
{
postUrl: "https://www.linkedin.com/3",
action: "Post",
profileUrl: "https://www.linkedin.com/company/3",
timestamp: "2019-10-09T09:40:05.356Z"
},
]
posts = shuffle(posts);
Can you see where I am going wrong? or how else to shuffle these objects?