let name;
let hobbie;
let occupation;
function setValue(aVariable, aValue){
aVariable = aValue;
}
setValue(name, "John");
setValue(hobbie, "Travelling");
setValue(occupation, "Programmer");
console.log(name); // returns -> undefined
console.log(hobbie); // returns -> undefined
console.log(occupation); // returns -> undefined
How do I change the value of the global variables by a function?