Shuffle an array in JavaScript

arr.sort(() => Math.random() - 0.5);