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

153
Views
Change color of random text in an array

I have a question, what if I have 50 strings in an array and I want to make the ones longer than 5letters have a red color, how do I do it? Please show help using the .map(function (element, index)if... method thanks

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You cannot set color of a string. You can use this objects: {string:<string>,isRed:false}, and the can use for loop:

for(let stringObj of strings) {stringObj.isRed=stringObj.string.lenght>5} //strings: that array which contains the 50 string object

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!