I am new to JS , I am trying to execute the following code and log the out put
var name ="xyz";
var age =10;
var location ={office:"US",home:"CA"};
function callFn(name,age, location){
name = "abc";
age =20 ;
location['office']="new office location";
}
callFn(name, age, location);
console.log(name, age, location['office']);
The output is "xyz", 10 , "new office location";
Why the name , age values are not chaning but key values inside object are changing ? IN other languges like java it will assign new values to name and age also