function isAllEqual(array) {
if (array.length > 0) {
return !array.some(function(value, index) {
return value !== array[0];
});
} else {
return true;
}
}
var arrsAll = ['1','1','1'];
console.log('isAllEqual',isAllEqual(arrsAll)); //true
2023-07-23 19:26:04
function isAllEqual(array) {
if (array.length > 0) {
return !array.some(function(value, index) {
return value !== array[0];
});
} else {
return true;
}
}
var arrsAll = ['1','1','1'];
console.log('isAllEqual',isAllEqual(arrsAll)); //true