Demo Forum Go back to the main website
No internet connection
  1. Home
  2. General

How can I convert a number to a string

By Gregor Adams @pixelass
    2022-06-29 15:56:12.249Z

    I have this code but it doesn't work.

    const number = 10;
    const string = number.tostring();
    Solved in post #2, click to view
    • 3 replies
    1. P
      Gregor Adams @pixelass
        2022-06-29 15:56:41.567Z

        You have a typo. it should be toString()

        const number = 10;
        const string = number.toString();
        1. JJessica Lörs @Jessica
            2022-06-29 15:59:33.769Z

            Yes, pixelass is right 👍

          • J
            In reply topixelass:
            Jessica Lörs @Jessica
              2022-06-29 16:00:07.601Z

              I don't know.