unicode string in javascript string code example
Example 1: javascript unicode to string
//convert unicode to string
// using a variable
let unicodeString = "http\\u00253A\\u00252F\\u00252Fexample.com\u{1F4A9}\x61";
console.log(decodeURIComponent(JSON.parse('"' + unicodeString.replace(/\"/g, '\\"') + '"')));
// direct approach
console.log(decodeURIComponent(JSON.parse('"http\\u00253A\\u00252F\\u00252Fexample.com\u{1F4A9}\x61"')));
Example 2: unicode javascript
click on source