An array of js objects determines whether a particular attribute is duplicated.

the code is as follows

{
  a: 1,
  b: 21,
},
{
  a: 1,
  b: 21,
},

ask for your advice

Jan.19,2022

gets the same attribute name and value, for reference only:

function getCommonObj(arr,key,val){//arrkeyval
        var valArr = []//
        for(var i=0; i< arr.length; iPP){
            if(arr[i][key] == val){
                valArr.push(arr[i])//
        }
        }
        if(valArr.length>=2){
            return valArr
        }
}


you are not right

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-1e4c202-44e8c.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-1e4c202-44e8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?