Reputation: 13291
> str = '\xae\xee'
'®î'
How to convert [0xae, 0xee] to '®î'?
Upvotes: 0
Views: 127
Reputation: 50639
You can use String.fromCharCode()
to convert the hex values to their string representation with .map()
and .join()
to form a string:
const hex = [0xae, 0xee];
const res = hex.map(s => String.fromCharCode(s)).join('');
console.log(res);
Upvotes: 3