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

171
Vistas
Text color based on true/false value

I would like to return a string in blue if is_active is true, and return it in grey if it's false. I have tried a couple of thing but can't make it work..

t2_array = [5, 7, 9, 11, 13, 17, 22, 25, 26, 29, 31, 35, 36, 39, 40, 44, 55, 77];

function t2PrintSlice(beg, end, is_active) {    
beg = t2_array.indexOf(5);
end = t2_array.indexOf(26);
is_active = t2_array.slice(beg, end).join(', ')+",";

if (is_active === true){
  is_active.addClass("range");
}else{
  is_active.addClass("transp");
}
    return "";
}

I should return a slice of the array in a color based on true/false.

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