Can anyone help me out here

You can’t have two following return statements like that.

You can add the return after the If closing bracket }

Like this:
If ( x < 5){
return ‘close’;
}
return ‘far’;
};

In this code, If the given value of x is bigger than or equals 5, It will pass over all If statements and fall on the last return, because It won’t satisfact any of the conditions inside the ifs