JS Built-ins
StringString.fromCharCodebeginner

String.fromCharCode() β€” single character

πŸ“– Usage Example
String.fromCharCode(65)        // β†’ 'A'
String.fromCharCode(97)        // β†’ 'a'
String.fromCharCode(72, 105)   // β†’ 'Hi'

Use String.fromCharCode() to create a string from one or more UTF-16 char code values.

String.fromCharCode()

String.fromCharCode(...codes) returns a string from one or more UTF-16 code unit values.

Challenge: Implement charFromCode(code) that returns the character for the given char code.

charFromCode(65) // β†’ 'A'
charFromCode(97) // β†’ 'a'
πŸ’‘ Hints (1)
  • β€’ ASCII code 65 = A, 97 = a, 48 = 0, 32 = space.