Convert a Number to a String!

Instructions: We need a function that can transform a number (integer) into a string. What ways of achieving this do you know? Examples (input --> output): 123 --> "123" 999 --> "999" -100 --> "-100" Thoughts: Changing a number to a string through toString() function. Solution: function numberToString(num) { return num.toString(); } This is a CodeWars Challenge of 8kyu Rank (https://www.codewars.com/kata/5265326f5fda8eb1160004c8/train/javascript)

Apr 21, 2025 - 18:58
 0
Convert a Number to a String!

Instructions:
We need a function that can transform a number (integer) into a string.
What ways of achieving this do you know?

Examples (input --> output):
123 --> "123"
999 --> "999"
-100 --> "-100"

Thoughts:
Changing a number to a string through toString() function.

Solution:
function numberToString(num) {
return num.toString();
}

This is a CodeWars Challenge of 8kyu Rank (https://www.codewars.com/kata/5265326f5fda8eb1160004c8/train/javascript)