- function setName(obj){
- obj.name = "Nicholas";
- obj = new Object();
- obj.name = "Greg";
- }
- var person = new Object();
- setName(person);
- alert(person.name); //"Nicholas"
- //该片段来自于http://www.codesnippet.cn/detail/2801201511679.html
来源: http://www.codesnippet.cn/detail/2801201511679.html