Hello! I have a doubt about function parameters and assignment in JavaScript.
function changeBackgroundColor(newColor) {
document.body.style.backgroundColor = newColor;
}
vs
function sendMe(y) {
y = 5;
}
In the first function, the parameter newColor is written on the right-hand side (RHS) of the assignment, even though it’s a parameter.
But in the second function, the parameter y is written on the left-hand side (LHS).
Why is that?