const allEqual = arr => arr.every(val => val === arr[0]);
      allEqual([1, 2, 3, 4, 5, 6]); // false
      allEqual([1, 1, 1, 1]); // true
      

      Javascript language logo
      All array elements equal

      Check if all elements in array are equal

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.