Sign in
Log inSign up

Arguments passing in JavaScript

Default profile photo
Anonymous
·Mar 12, 2018
function SetName(obj){
  obj.name="Stevce";
  obj = new Object();
  obj.name="greg";
}
var person = new Object();
SetName(person);

alert(person.name);

Here my question is whether the person is passed to the function as a reference or value ,In some book it has been written that all the function argument in EcmaScript are passed by values .