Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
137
rated 0 times [  138] [ 1]  / answers: 1 / hits: 22199  / 13 Years ago, wed, june 15, 2011, 12:00:00

How do I reverse the digits of a number using bitwise?



input:



x = 123; 


output:



x = 321; 


How Do this?


More From » javascript

 Answers
6

If you wanted to make a simple reversal:



var x = 123;
var y = x.toString();
var z = y.split().reverse().join();
var aa = Number(z);
document.write(aa);


http://jsfiddle.net/jasongennaro/gV39e/


[#91705] Monday, June 13, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jacie

Total Points: 490
Total Questions: 111
Total Answers: 105

Location: Mali
Member since Sat, Feb 12, 2022
2 Years ago
;