I'm trying to use a variable and \u to create an UTF character with Node.js.
var code = '0045';
console.log('\u0045', '\u' + code);
But the output becomes
E u0045
How do I make it
E E
How do I create the character and store it in a variable?
Use String.fromCharCode:
String.fromCharCode(0x0045)
String.fromCharCode(parseInt('0045', 16))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With