I'm having a problem where I'm trying to send parameters from one function to another, the function that receives the parameters uses a switch statement to evaluate it and returns it but it just returns what ever variable I put into it instead of "senior Master" for example. Here is the code I don't get what I'm doing wrong, just keep in mind I'm very new to coding maybe someone can give me some pointers. Thanks in advance.
function calculatexxx(x) {
let calculatexxx= x;
switch (x) {
case (x >= 2400):
console.log("Senior Master");
break;
case (2399 > x > 2200):
console.log("National Master");
break;
case (2199 > x> 2000):
console.log("Expert");
break;
case (1999 > x> 1800):
console.log("Class A");
break;
case (1799 > x> 1600):
console.log("Class B");
break;
default:
console.log("Error input not valid");
return(x);
}
}
function displayxxx() {
console.log("Your Rank is: " + calculatexxx(2400)); //
}
displayxxx();