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

234
Views
Does String.prototype.normalize() method guarantees the same abstract character equal?

I found normalize method on MDN.

Assume the API response from the server-side is like this: {name: "李"}. The Unicode of the 李 is \uF9E1.

Now, on client-side, can we use it in the if...else... condition like this:

// We type the '李' string, the unicode of this '李' is \u674E
if(name.normalize() === '李'.normalize()) {
   // do something
}

Does String.prototype.normalize() method guarantees the same abstract character equal? So that we can compare these abstract characters in the condition with no worry.

Or, the best practice is never to return data with abstract characters in API and compare them? Instead, we should return the data from server-side like {name: '李', code: 0 } and use the code field(number data type) to compare.

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!