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

161
Views
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 answers
Answer question

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