Skip to content
Prev Previous commit
Corrected the definition of call by value and reference
  • Loading branch information
Radhikajram committed Jul 29, 2019
commit 710ea9f97a8b05a59bc89ec53e4f50c08d3dcf73
4 changes: 2 additions & 2 deletions Week3/homework/step2-7.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ console.log(y);

/* Add your explanation as a comment here
1. X is declared as global variable.Though it is parameter of function, it is manipulated inside the function but
return value is not captured anywhere.The scope of the passed value is within
.The scope of the passed value is within
the scope of function.So console of x still display the value as 9.

2. The x is one of the reference variable inside the object. The function directly manipulates the x value and whenever
2. The x is one of the reference variable inside the object. The function manipulates the x by its reference and whenever
the reference of object is made we are getting the updated value of x. */