A simplified example:function logTheColor (color){    if(color == red){        color = The color is red     } else if (color == yellow) {        color = The color is yellow     } else {        color =  The color is blue    }       console.log(color);}Is there something wrong with overwriting the value of the variable inside an if statement, if that variable is also part of the if statement condition?  My question is not about the ways I can achieve the same in a clean way, I just want to know if it's right although it seems like a bad practice.  I don't see any problem in this particular case cause I don't have to re-evaluate the color variable with the original content again. Am I missing something? Are there cases when it really matters?
Overwriting and returning the value of the argument used as conditional of an if statement, inside the same if statement
javascript;variables;if statement