What is call by value and call by reference in JavaScript?
Firstly, what do you think the result of this code:
var x=5;
var z=x;
console.log("x=" ,x , "z=",z);
Simply, it's ๐:
Output
x=5 , z=5
If we change only the value of x, what do you think the output is?
x=7;
console.log("x=" ,x , "z=",z);...
codenuggets.hashnode.dev2 min read