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

824
Vistas
can we validate multiple functions inside if condition with AND operator using java script is there any other way to check multiple functions true?

I have added these functions and need return something based which function is returning true but it is not working.

//this is function1/
function A() {
  return true;
}

function B() {
  return true;
}

function C() {
  if ({
      {
        var -customJS - page_type_lookup
      }
    } === 'product') {
    var config = document.querySelector('#product-content > div.product-variations.clearfix > div.attribute.variant-dropdown > div.attribute-values-section > div.label.va-navSectionalOrientation').innerText;
    if (config.includes('Sectional Orientation')) {
      return true;
    } else {
      return false;
    }
  }
}
if (A() === true && B() === true && C() === true) {
  return 'A+ Content, RTA Product, Sectional Configurator';
} else if (A() === true && B() === true) {
  return 'A+ Content, RTA Product';

} else if (B() === true && C() === true) {
  return 'RTA Product, Sectional Configurator';
} else if (C() === true && A() === true) {
  return 'Sectional Configurator, A+ Content';
} else if (A() === true) {
  return 'A+ Content';
} else if (B() === true) {
  return 'RTA Product';
} else {
  return 'Sectional Configurator';
}
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you have more than one function and a data set which reflects the wanted value of each flag, you could take an array for the functions retun values and another for the strings which are filterd and joined for the result.

const
    flags = [a(), b(), c()],
    result = ['A+ Content', 'RTA Product', 'Sectional Configurator']
        .filter((_, i) => flags[i])
        .join(', ');
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