How do I reverse the digits of a number using bitwise?
input:
x = 123;
output:
x = 321;
//reverse integer const revInt = (num)=>{ //turn into string if(Math.sign(num)===1) return parseInt(num.toString().split('').reverse().join('')); else return -1*parseInt(num.toString().split('').reverse().join('')); } console.log(revInt(-501));