Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

316
Views
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 original

{
    "XX.g1(\"A\u0017BV\", JU)": "span",
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!