How to determine whether the values in the array are equal.

how to determine that all values in an array are equal to one value.

var array = ["success","success"];
var A1 =" success";

could you tell me how to judge this? Can you give me a few more examples? Thank you

Oct.24,2021

console.log(array.every(item=>item===a1))

var array = ['success','success','success','success'];
var a1 = 'success';

var isEquality = array.every((val) => {
    return val === a1;
});

console.log(isEquality);        // true

like this?


the first type:


return array.join("").replace(new RegExp(a1,'g'),"") === ""
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b5f2-2ba07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b5f2-2ba07.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?