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

79
Vistas
Check whether url from api data contain a particular string

I have my JSON data from API stored in map now one of its data is named with URL and contains URL of the sites I have to check whether the URL contains a particular string or not so that I can apply different styling to the div on HTML

let x = `${ values.url }`;
      if (x.contains("codeforces")) {
        console.log("Yes");
      }

I am getting error while using this:

console error

Please help me with this.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I think you want to use includes function. There is no function called contains

let x = values.url;
  if (x.includes("codeforces")) {
    console.log("Yes");
  }

Let me know if it helps :)

about 4 years ago · Juan Pablo Isaza Denunciar
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