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

164
Views
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
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!