I have define an object in variable "c". I have also make a function in which I passed a object. When I do changes in that variable it is also changing original object but my concern is why below given statement is not working with that object. fiddle
function changeParam(x, y, z) {
x = 3;
y = "new string";
z["key2"] = "new";
z["key3"] = "newer";
z = {"new" : "object"};
}
var a = 1,
b = "something",
c = {"key1" : "whatever", "key2" : "original value"};
var m=c;
changeParam(a, b, c);
console.log(c)
console.log(m)