Skip to content

String.fromCharCode

Arsen Melikyan edited this page · 1 revision
Clone this wiki locally

String.fromCharCode()

The static String.fromCharCode() method returns a string created by using the specified sequence of Unicode values.

Syntax

String.fromCharCode(num1[, ...[, numN]])

Parameters

num1, ..., numN

A sequence of numbers that are Unicode values.

MDN link | MSDN link

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.

Examples

String.fromCharCode(65, 66, 67);  // "ABC"
var test = String.fromCharCode(112, 108, 97, 105, 110);
document.write(test);

// Output: plain
Something went wrong with that request. Please try again.