My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

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 .