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

822
Views
¿Podemos validar varias funciones internas si la condición con el operador AND usa el script Java? ¿Hay alguna otra forma de verificar que varias funciones sean verdaderas?

He agregado estas funciones y necesito devolver algo basado en qué función devuelve verdadero pero no funciona.

 //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 answers
Answer question

0

Si tiene más de una función y un conjunto de datos que refleja el valor deseado de cada bandera, puede tomar una matriz para los valores de retorno de las funciones y otra para las cadenas que se filtran y unen para obtener el resultado.

 const flags = [a(), b(), c()], result = ['A+ Content', 'RTA Product', 'Sectional Configurator'] .filter((_, i) => flags[i]) .join(', ');
about 4 years ago · Juan Pablo Isaza Report
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!