生成一个数字的翻转数
function generateReverseNum(num) {
let rev = 0;
let n = num;
while(n > 0) {
rev = 10 * rev + n % 10;
n = Math.floor(n/10)
}
return rev;
}
function generateReverseNum(num) {
let rev = 0;
let n = num;
while(n > 0) {
rev = 10 * rev + n % 10;
n = Math.floor(n/10)
}
return rev;
}
本文标题:JS功能方法
本文链接:https://www.haomeiwen.com/subject/qmvccdtx.html
网友评论