let arr = ["2", "4", "6", "8", "10", "12", "14", "16", "18", "20", "22", "24", "27", "30", "33", "36", "42", "48", "54", "60"]
var rr = [];
function name(n) {
let num = Number(n);
for (let i = 0; i < arr.length; i++) {
const element = arr[i];
if(element!=num){
rr.push(num--);
}
}
return rr.find((el)=>{
let newel = String(el);
return arr.includes(newel);
})
}
let newn = String(name("56"));
console.log(newn);
。。。。。。。。。。。。。
作者:Vam的金豆之路
篇幅有限更多请见扩展链接:
http://www.mark-to-win.com/tutorial/50905.html