15 Javascript codes you will always need

  Shuffle an Array Shuffling an array is super easy with sort and random methods. const shuffleArray = (arr) => arr.sort(() => 0.5 – Math.random());console.log(shuffleArray([1, 2, 3, 4]));// Result: [ 1, 4, 3, 2 ] Check if Date is Valid Use the following snippet to check if a given date is valid or not. const isDateValid = (…val) => … Read more