Hello summer!

Report a typo

Write a function called codeValuesToString() that takes an array of numbers as input and returns a string where each number corresponds to the UTF-16 code unit value.

To read each element in the codeValues array, you can loop through it inside the function.

Sample Input 1:

72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33

Sample Output 1:

Hello world!
Write a program in JavaScript
function codeValuesToString(codeValues) {
let result = '';
/* Do not change code above */

//Write your code here

/* Do not change code below */
return result;
}

process.stdin.setEncoding('utf8');
process.stdin.on('data', (data) => {
const inputArray = data.trim().split(/,\s*/).map(Number);

const outputString = codeValuesToString(inputArray);

process.stdout.write(outputString);
});
___

Create a free account to access the full topic