About 547,000 results
Open links in new tab
  1. JavaScript Program to Reverse Digits of a Number

    Aug 21, 2024 · In this approach, Using the reduce () method, reverse the digits of a number. Convert the number to an array of its digits, then employ the reduce () function with a spread …

  2. JavaScript: How to reverse a number? - Stack Overflow

    Jun 14, 2022 · Below is my source code to reverse (as in a mirror) the given number. I need to reverse the number using the reverse method of arrays. var a = prompt("Enter a value"); var b, …

  3. JavaScript function: Reverse a number - w3resource

    Feb 28, 2025 · Write a JavaScript function that reverses the digits of a floating-point number and correctly places the decimal point in the output. Write a JavaScript function that reverses a …

  4. JavaScript Reverse Number - StudyFame

    Reverse number program in JavaScript using do while loop. In this program, you will take numbers from users using the javascript prompt method and reverse those numbers by using …

  5. How to reverse a number in JavaScript - CodeVsColor

    Apr 8, 2023 · You will learn how to use a while loop, how to use the modulo operation, and how to find the floor value of a number in JavaScript with these examples. We will also write it with …

  6. Reverse a Number in Javascript - Scaler

    Dec 4, 2022 · Let's take a look at the most popular ways of creating new lines with JavaScript. Algorithm to Reverse a Number. Basically, this approach works on the removal of the last digit …

  7. How to reverse a number in JavaScript - freeCodeCamp.org

    Feb 3, 2019 · Solving with an Arrow Function: const reversedNum = num => parseFloat (num.toString().split('').reverse().join('')) * Math.sign(num) Solving with a Regular Function: …

  8. Write a Custom JavaScript function to reverse a number

    In the below code, rev_num () is a function that will return a reverse number of the input number. In this way, we learned how to create a Javascript function to reverse a number.

  9. Write a program to reverse digits of a number - GeeksforGeeks

    Mar 19, 2025 · Using Recursion. This approach uses a recursive function reverseDigits called with the number n and an accumulator variable revNum to store the reversed number, and …

  10. JavaScript Number Split into individual digits - Stack Overflow

    If you want the sum of individual digits, you can use the reduce function (implemented from Javascript 1.8) like this (111 + '').split('').reduce(function(previousValue, currentValue){ return …

Refresh