如果一個物件型別 作為函式參數傳遞,一樣是傳址行為: function foo(obj) { obj.a = 10; } var obj1 = {}; foo(obj1); obj1; // console.log: { a: 10 }.
確定! 回上一頁