We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c5e94e commit 48b7b3bCopy full SHA for 48b7b3b
docs/1-trial-session/11-object/index.md
@@ -2,6 +2,7 @@
2
title: オブジェクト
3
---
4
5
+import Answer from "@site/src/components/Answer";
6
import Term from "@site/src/components/Term";
7
import ViewSource from "@site/src/components/ViewSource";
8
@@ -71,4 +72,19 @@ const nextYearTanaka = incrementAge(tanaka);
71
72
document.write(nextYearTanaka.age); // 19 と表示されてほしい
73
```
74
75
+<Answer type="年齢を増やす">
76
+
77
+```javascript
78
+function incrementAge(person) {
79
+ person.age = person.age + 1;
80
+ return person;
81
+}
82
83
+const tanaka = { name: "田中", age: 18 };
84
+const nextYearTanaka = incrementAge(tanaka);
85
+document.write(nextYearTanaka.age);
86
+```
87
88
<ViewSource url={import.meta.url} path="_samples/incrementAge" />
89
90
+</Answer>
0 commit comments