String.fromCodePoint(parseInt(arr[0].replace(/&#x|;/g,''),16))
//
Try this first we replace '&#x'
and ';'
with ''
, then with parseInt()
we convert it from hexadecimal to decimal, then with String.fromCodePoint()
we convert the decimal code point into a Javascript string.