Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

232
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda