Periksa apakah setiap nilai dalam array sama
const allEqual = arr => arr.every( v => v === arr[0] )
allEqual( [1,1,1,1] ) // true
Wide-eyed Willet
const allEqual = arr => arr.every( v => v === arr[0] )
allEqual( [1,1,1,1] ) // true