Skip to main content
Version: 3.28.0

String.fromCharCode()

The static String.fromCharCode() method returns a string created from the specified sequence of UTF-16 code units.

Syntax

String.fromCharCode(num1)
String.fromCharCode(num1, num2)
String.fromCharCode(num1, num2, /* …, */ numN)

Parameters

  • num1, ..., numN
    • : A sequence of numbers that are UTF-16 code units. The range is between 0 and 65535 (0xFFFF). Numbers greater than 0xFFFF are truncated. No validity checks are performed.

Return value

A string of length N consisting of the N specified UTF-16 code units.

Description

This method returns a string and not a String object.

Because fromCharCode() is a static method of String, you always use it as String.fromCharCode(), rather than as a method of a String object you created.