JS Built-ins
StringString.fromCodePointbeginner

String.fromCodePoint() β€” basic usage

πŸ“– Usage Example
String.fromCodePoint(65)       // β†’ 'A'
String.fromCodePoint(9731)     // β†’ 'β˜ƒ'
String.fromCodePoint(128512)   // β†’ 'πŸ˜€'

Use String.fromCodePoint() to create a string from Unicode code point values, including characters outside the BMP.

String.fromCodePoint()

String.fromCodePoint(...codePoints) returns a string from Unicode code point values. Unlike fromCharCode, it handles the full Unicode range including supplementary characters.

Challenge: Implement charFromCodePoint(cp) that returns the character for the given code point.

charFromCodePoint(65) // β†’ 'A'
charFromCodePoint(9731) // β†’ 'β˜ƒ'
πŸ’‘ Hints (1)
  • β€’ `String.fromCodePoint` accepts the same values as `String.fromCharCode` for BMP characters.