Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

162
Vistas
How do I solve X is 7 or more greater than Y

How do i solve this problem:

if X is 7 or more greater than Y in javascript show green.

if X if from 4-7 greater than Y show blue.

else show red

this is what i have tried so far:

function solve (x,y) {
            if(x > (y +7) ){
                return "green"
            }

            else {
                return "red";
            }

}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Probably because that function isn't closed

By the way you can't say something ISN'T WORKING if you don't provide the complete code that doesn't work and the error

Anyway

The right code would be

    function solve (x,y) {
            if(x >= (y +7) ){
                return "green"
            }

            else {
                return "blue";
            }
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda