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";
}
}
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";
}
}