What is the best way to shuffle elements in a JavaScript array, and how can I ensure the result is truly random?

If you’re already using Lodash in your project, take the easy route. I totally do this too when I don’t feel like writing the logic from scratch.

const _ = require('lodash');
const arr1 = ["a", "b", "c", "d"];
console.log(_.shuffle(arr1));