← Back to challenges

Char-to-ASCII

JavaScriptHardnumbersalgorithmsstrings

Instructions

Create a function that returns the ASCII value of the passed in character.

Examples

ctoa("A") ➞ 65

ctoa("m") ➞ 109

ctoa("[") ➞ 91

ctoa("\") ➞ 92
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Minimal IX: This or That