'Javascript toString() forces ASCII character to change to hex
I'm having a little problem with toString(), when I'm changing the whole function to string to match with regex, toString() changes special characters to HEX, but I need them to stay as they were original in the function as I need to match them later original to original with search and replace function.
Here is an example.
// I'm matching XX.g1("ABV", JU)
function wd () {
var Dq = document["createElement"](XX.g1("ABV", JU));
}
const regex = / /
const l = wd.toString().match(regex);
let obj = {};
for (let i = 0; i < l.length; i++) {
const e = l[i]
console.log(e)
obj[e] = eval(e)
}
returning XX.g1(\"A\u0017BV\", JU) but I need it to be formated as on the picture

{
"XX.g1(\"A\u0017BV\", JU)": "span",
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
