In PHP it is possible to pass variables by reference when we flag the parameter name with a &
before. And so, the variable can be changed without reassignment of value.
Example:
function fn(&$x) {
$x *= 5;
}
$y = 2;
fn($y);
echo $y; // Imprime 10
And in the javascript? Is there any way to do something similar?