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

142
Views
JavaScript sorting of an RGB array

This is the task:

Colors have to be ordered in such way:

  • Higher Red value first; if the same then:

  • Higher Green value first; if the same then:

  • Higher Blue value first; if the same then on the same position

The task is as follows. I don't know how to do it or what it is supposed to look like. Ideally, the function should take an array of colors in HEX. E.g:

  [

    "#FF1100",

    "#44FF00",

    "#1900FF",

    "#E02500",

    "#54E600",

    "#0206DE",

   ]

And then it returned the sorted array as in the task. How can I do it? I am stuck.

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

0

Simple sort with reverse should work:

yourData.sort().reverse()

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!