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));
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));