Skip to content

Demonstrate two object property access methods in myFunction#1

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-33390781-1209491583-a719d2b2-02c7-483a-9ea3-5f08a771027b
Draft

Demonstrate two object property access methods in myFunction#1
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-33390781-1209491583-a719d2b2-02c7-483a-9ea3-5f08a771027b

Conversation

Copilot AI commented Apr 15, 2026

Copy link
Copy Markdown

The page title advertised "两种方式访问对象" (two ways to access objects), but myFunction only called person.fullname() — showing neither access method explicitly.

Changes

  • index.js: Rewrote myFunction to display both access patterns side-by-side in the DOM:
    • Dot notation: person.name, person.job
    • Bracket notation: person["name"], person["job"]
function myFunction() {
    var result1 = "方式一(点符号):" + person.name + "," + person.job;
    var result2 = "方式二(方括号):" + person["name"] + "," + person["job"];
    document.getElementById("demo").innerHTML = result1 + "<br>" + result2;
}
Original prompt

测试

创建自 VS Code

Copilot AI changed the title [WIP] 测试 Demonstrate two object property access methods in myFunction Apr 15, 2026
Copilot AI requested a review from GinTama12 April 15, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants