Well, there are multiple methods to do this.
Let’s say the number was
The first method would be to use the
String function, rather than
String(5) // this should equal "5"
The second method would be to add the 5 with a string. When you add a number with a string, the number is automatically converted to a string, which is kinda nice. In the example below, I added (or rather, joined ) an empty string
"" with the number
""+5 // this should equal "5"
(Fun fact, you can also convert a string to a number by multiplying it by 1, or using the