← Back to challenges

String and Number Conversions

JavaScriptHardlanguage_fundamentalsnumbersstrings

Instructions

You need to create two functions to substitute toString() and parseInt(); A function called intToString() that converts integers into strings and a function called stringToInt() that converts strings into integers.

Examples:

intToString(4) ➞ "4"

stringToInt("4") ➞ 4

intToString(29348) ➞ "29348"

Notes

You will get bonus points if you manage to solve this without using toString, parseInt or parseFloat.

javascript
Loading editor…
⌘ ↵ to run
Walks through the solution with reasoning and edge cases.