Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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 Respostas
Responde à pergunta

0

Simple sort with reverse should work:

yourData.sort().reverse()

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda