// 抽中的20个号码
const winningArr = ['02', '04', '11', '12', '13', '17',
'20', '26', '28', '35', '37', '48', '53', '58', '59',
'61', '69', '71', '72', '79']
const arr1 = ['02', '11', '24', '32', '39', '47', '53', '54', '70', '79']
const arr2 = ['07', '18', '28', '31', '43', '45', '51', '62', '68', '77']
const arr3 = ['03', '17', '22', '34', '36', '50', '57', '58', '69', '80']
const arr4 = ['07', '10', '15', '21', '37', '41', '55', '56', '62', '71']
const arr5 = ['01', '10', '13', '20', '22', '39', '48', '56', '66', '78']
const arr6 = ['07', '14', '24', '25', '37', '48', '55', '65', '77']
const arr7 = ['04', '17', '23', '37', '48', '63', '63', '72', '73']
const arr8 = ['03', '12', '27', '38', '43', '44', '58', '67', '78']
const arr9 = ['03', '11', '19', '21', '36', '45', '55', '68', '78']
const arr10 = ['02', '15', '16', '22', '37', '48', '57', '66', '73']
function comparison(arr) {
const winSet = new Set(winningArr);
const arrSet = new Set(arr);
// 交集
const intersect = [...new Set([...winSet].filter(x => arrSet.has(x)))]
return intersect
}
console.log('以下为10号......')
console.log(comparison(arr1))
console.log(comparison(arr2))
console.log(comparison(arr3))
console.log(comparison(arr4))
console.log(comparison(arr5))
console.log('以下为9号......')
console.log(comparison(arr6))
console.log(comparison(arr7))
console.log(comparison(arr8))
console.log(comparison(arr9))
console.log(comparison(arr10))
console