Skip to content
  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in
Logo1

zhangtingyan / my-project

Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • my-project
  • js变量
  • 引用类型.html
  • zhangtingyan's avatar
    文件复制 · 11324a7b
    zhangtingyan committed Mar 25, 2020
    11324a7b Browse Files
引用类型.html 259 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<html>
<head>
</head>
<body>
<script>
function setName(obj){
    obj.name = 'a';
    obj = new Object();
    obj.name = 'b';
    return obj;
}
var p = new Object();
var p2 = setName(p);
alert(p.name); // a
alert(p2.name); // b
</script>
</div>
</body>
</html>