Compruebe si la matriz tiene los mismos valores JavaScript
const allEqual = arr => arr.every(v => v === arr[0]);
allEqual([1,1,1,1]); // true
TC5550
const allEqual = arr => arr.every(v => v === arr[0]);
allEqual([1,1,1,1]); // true
const intersection = array1.filter(element => array2.includes(element));
// how to check all values of an array are equal or not in javascript
const allEqual = (arr) => arr.every(val => val === arr[0]);
console.log(allEqual([1, 2, 3, 4, 5, 6])); // false
console.log(allEqual([1, 1, 1, 1])); // true
const age= [2,7,12,17,21];
age.every(function(person){
return person>18;
}); //false
//es6
const age= [2,7,12,17,21];
age.every((person)=> person>18); //false
const allEqual = arr => arr.every( v => v === arr[0] )
allEqual( [1,1,1,1] ) // true