← Back to challenges

Hidden Calculator Words

JavaScriptHardnumbersstringsloops

Instructions

At school, we used to play with our calculators and send each other secret messages. The trick was to enter a special number and turn the calculator upside-down. LOL ... I mean 707!

Given a number, create a function that converts it into a word by turning the integer 180 degrees around.

Examples

turnCalc(707) ➞ "LOL"

turnCalc(5508) ➞ "BOSS"

turnCalc(3045) ➞ "SHOE"
numberletter
1I
2Z
3E
4H
5S
6G
7L
8B
9-
0O

Notes

  • Convert to uppercase words.
  • Ignore dots.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: RegEx: Boundary Assertions III