Open In App

TypeScript String String.fromCodePoint() Method

Last Updated : 24 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The fromCodePoint() is an inbuilt TypeScript String method. It is mainly used to get the string value of any given Unicode point value. This method is really helpful when you want to handle characters that are not readily available through keyboard input.

Syntax:

String.fromCodePoint(...codePoints: number[]): string

Parameters:

  • ...codePoints: An array of one or more non-negative integer values that represent Unicode code point values.

Return Value:

Returns a string that is created from given Unicode points.

Example 1: Here we are going to create a grinning face emoji by unicode point.

JavaScript
const e: number = 0x1F60A;
const emoji: string = String
    .fromCodePoint(e);
console.log(emoji); 

Output:

?

Example 2: Here we are going to create a grinning musical note emoji by Unicode point.

JavaScript
const f: number = 0x1F3B6;
const musicalNote: string = String
    .fromCodePoint(f);
console.log(musicalNote);

Output:

?

Next Article

Similar Reads