题解 | #向下取整#
整数反转
http://www.nowcoder.com/practice/eceaa68482354edf9c3409c5b3e942b9
function _reverse(number) {
// 补全代码
let arr = String(number).split('');
let l = 0;
if(arr[0] === '-') l = 1;
let r = arr.length - 1;
if(arr.length === 1) return number;
while(l <= r){
[arr[r],arr[l]] = [arr[l],arr[r]];
l++;
r--;
}
return Number(arr.join(''));
}