chr()

chr(n) → string | null

Returns a 1-byte string whose byte value is n — the inverse of string.at(). (Global function.)

Builds a single-byte string from a numeric value. If n is not numeric or is outside the 0–255 range, null is returned.

Arguments

NameTypeRequiredDefaultDescription
n number yes Byte value, 0–255.

Returns

string | null A 1-byte string, or null for invalid input.

Example

chr(0x61) === 'a';