function Point(x,y){ return {x:x, y:y}; } var p1 = Point(3,4); var a = 7; var b = Calc(a,p1); console.log(a, p1.x); function Calc(a, p){ a= 99; p.x = 24; return a; }
Output: