let aaa = [
{name: '22:tcp', port: '22', protocol: 'tcp', portGroup: null},
{name: '80:tcp', port: '80', protocol: 'tcp', portGroup: null},
{name: '111:tcp', port: '111', protocol: 'tcp', portGroup: null},
{name: '111:tcp', port: '111', protocol: 'tcp', portGroup: null},
{name: '111:udp', port: '111', protocol: 'udp', portGroup: null},
{name: '111:udp', port: '111', protocol: 'udp', portGroup: null},
{name: '323:udp', port: '323', protocol: 'udp', portGroup: null},
{name: '323:udp', port: '323', protocol: 'udp', portGroup: null},
{name: '443:tcp', port: '443', protocol: 'tcp', portGroup: null},
{name: '2222:tcp', port: '2222', protocol: 'tcp', portGroup: null},
{name: '2222:tcp', port: '2222', protocol: 'tcp', portGroup: null},
{name: '5432:tcp', port: '5432', protocol: 'tcp', portGroup: null},
{name: '5432:tcp', port: '5432', protocol: 'tcp', portGroup: null},
{name: '6100:tcp', port: '6100', protocol: 'tcp', portGroup: null},
{name: '6641:tcp', port: '6641', protocol: 'tcp', portGroup: null},
{name: '6642:tcp', port: '6642', protocol: 'tcp', portGroup: null},
{name: '7410:udp', port: '7410', protocol: 'udp', portGroup: null},
{name: '8702:tcp', port: '8702', protocol: 'tcp', portGroup: null},
{name: '8706:tcp', port: '8706', protocol: 'tcp', portGroup: null},
{name: '8707:tcp', port: '8707', protocol: 'tcp', portGroup: null},
{name: '9090:tcp', port: '9090', protocol: 'tcp', portGroup: null},
{name: '9696:tcp', port: '9696', protocol: 'tcp', portGroup: null},
{name: '35357:tcp', port: '35357', protocol: 'tcp', portGroup: null},
{name: '50001:tcp', port: '50001', protocol: 'tcp', portGroup: null},
{name: '54323:tcp', port: '54323', protocol: 'tcp', portGroup: null},
{name: '54324:tcp', port: '54324', protocol: 'tcp', portGroup: null},
]
function noRepeat(arr,flagName) {
var newArr=[];
for(var i=0;i<arr.length;i++) {
var flag = true;
for(var j=0;j<newArr.length;j++){
if(arr[i][flagName] === newArr[j][flagName]){
flag = false;
continue;
}
}
if(flag){
newArr.push(arr[i])
}
}
return newArr
}
console.log(noRepeat(aaa,'protocol'))
console