The following code shows how to Find Reverse of a Number in JavaScript

<html>
<head>
  <title>Reverse of a Number</title>
  <script>
     var num;
     num=prompt("Enter a number: ");
     len=num.length;
     num=Number(num);
     var n=num;
     var sum=0;
     var i=len-1;
     while(n>0)
     {
        var rem=n%10;
        sum=sum+rem*Math.pow(10, i);
        n=Math.floor(n/10);
        i=i-1;
      }
     document.write("Original Number: "+num+"<br/>Reversed Number:  "+sum);
     
  </script>
</head>
<body>
</body>
</html>

Output

Program to Find Reverse of a Number in JavaScript
Program to Find Reverse of a Number in JavaScript

Further Reading

Evolution of JavaScript from ES1 to ES2020

Introduction to HTML DOM Methods in JavaScript

JavaScript Practice Exercise

programmingempire