。。。。
function outNum(arr){ let oldArr = arr let newArr = [] a1 = Math.floor(Math.random()*arr.length) newArr.push(oldArr[a1]) oldArr.splice(a1, 1) a2 = Math.floor(Math.random()*arr.length) newArr.push(oldArr[a2]) oldArr.splice(a2, 1) a3 = Math.floor(Math.random()*arr.length) newArr.push(oldArr[a3]) oldArr.splice(a3, 1) if(newArr[a1] + newArr[a2] + newArr[a2] % 10 !=0){ console.log(oldArr) console.log(newArr) return 0 }else { console.log(newArr[a1] + newArr[a2] + newArr[a2]) if(oldArr[0]+oldArr[1] %10 == 1){ return 1 }else if (oldArr[0]+oldArr[1] %10 == 2) { return 2 }else if (oldArr[0]+oldArr[1] %10 == 3) { return 3 }else if (oldArr[0]+oldArr[1] %10 == 4) { return 4 }else if (oldArr[0]+oldArr[1] %10 == 5) { return 5 }else if (oldArr[0]+oldArr[1] %10 == 6) { return 6 }else if (oldArr[0]+oldArr[1] %10 == 7) { return 7 }else if (oldArr[0]+oldArr[1] %10 == 8) { return 8 }else if (oldArr[0]+oldArr[1] %10 == 9) { return 9 }else if (oldArr[0]+oldArr[1] %10 == 0) { return 10 } } }