Skip to content

Instantly share code, notes, and snippets.

@amoilanen
Created August 26, 2026 20:22
Show Gist options
  • Select an option

  • Save amoilanen/4cced4eedbcbb763bdeaec3886e80521 to your computer and use it in GitHub Desktop.

Select an option

Save amoilanen/4cced4eedbcbb763bdeaec3886e80521 to your computer and use it in GitHub Desktop.
Convert an array of ASCII codes into a String
// Converts an array of ASCII character codes into a String.
function asciiToString(codes) {
// String.fromCharCode expands the array into individual char-code arguments
return String.fromCharCode(...codes);
}
// The specific input to decode
const input = [
82, 101, 100, 105, 115, 69, 114, 114, 111, 114, 58, 32, 73, 110,
118, 97, 108, 105, 100, 32, 83, 69, 84, 32, 99, 111, 109, 109, 97,
110, 100, 32, 115, 121, 110, 116, 97, 120,
];
// Call the function and print the result
console.log(asciiToString(input));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment