When I try to use a string template to generate an emoji I get an error.
How to achieve this purpose?
Javascript code:
const unifiedValue = '1F60E';
const emoji = `\u{${ unifiedValue }}`;
Javascript error:
SyntaxError: Invalid escape sequence in template
Of course if I use the value directly it works, but that would be error-prone + thousands lines of code with hundreds of if
conditions.
Developer console:
'\u{1F60E}'
Console Output: ""