Created
August 26, 2026 20:22
-
-
Save amoilanen/4cced4eedbcbb763bdeaec3886e80521 to your computer and use it in GitHub Desktop.
Convert an array of ASCII codes into a String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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