Reputation: 7893
I wanted to add emoji to my string as UTF-8 code:
var c11 = new Road('/hl','\u{1F1F3-1F1F1} netherlands', node4);
According to link, It is Netherlands flags emoji UTF-8 code. When I started my javascript app it throws me this error:
var c11 = new Road('/hl', '\u{1F1F3-1F1F1} netherlands', node4);
^^^^^^^^^
SyntaxError: Unexpected token ILLEGAL
at exports.runInThisContext (vm.js:53:16)
When I write other emojis which has no dash symbol (for example \u{1F338}
) it works nice. Why I can't use flags?
Upvotes: 1
Views: 531
Reputation: 4696
Just use \u{1F1F3}\u{1F1F1}
instead of \u{1F1F3-1F1F1}
.
Upvotes: 2