File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
docs/1-trial-session/11-object Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ function incrementAge(person) {
33 return person ;
44}
55
6- const tanaka = { name : "田中" , age : 18 } , sato = { name : "佐藤" , age : 22 } ;
6+ const tanaka = { name : "田中" , age : 18 } ,
7+ sato = { name : "佐藤" , age : 22 } ;
78const nextYearTanaka = incrementAge ( tanaka ) ;
89const nextYearSato = incrementAge ( sato ) ;
9- document . write ( `田中は ${ nextYearTanaka . age } 歳、佐藤は ${ nextYearSato . age } 歳` ) ;
10+ document . write (
11+ `田中は ${ nextYearTanaka . age } 歳、佐藤は ${ nextYearSato . age } 歳` ,
12+ ) ;
Original file line number Diff line number Diff line change @@ -136,11 +136,14 @@ function incrementAge(person) {
136136 // ここに書く
137137}
138138
139- const tanaka = { name: " 田中" , age: 18 }, sato = { name: " 佐藤" , age: 22 };
139+ const tanaka = { name: " 田中" , age: 18 },
140+ sato = { name: " 佐藤" , age: 22 };
140141const nextYearTanaka = incrementAge (tanaka);
141142const nextYearSato = incrementAge (sato); // 同じ関数を tanaka と sato に使い回せる
142143// 19 歳、23 歳 と表示されてほしい
143- document .write (` 田中は ${ nextYearTanaka .age } 歳、佐藤は ${ nextYearSato .age } 歳` );
144+ document .write (
145+ ` 田中は ${ nextYearTanaka .age } 歳、佐藤は ${ nextYearSato .age } 歳` ,
146+ );
144147```
145148
146149<Answer title =" 年齢を増やす " >
@@ -151,10 +154,13 @@ function incrementAge(person) {
151154 return person;
152155}
153156
154- const tanaka = { name: " 田中" , age: 18 }, sato = { name: " 佐藤" , age: 22 };
157+ const tanaka = { name: " 田中" , age: 18 },
158+ sato = { name: " 佐藤" , age: 22 };
155159const nextYearTanaka = incrementAge (tanaka);
156160const nextYearSato = incrementAge (sato);
157- document .write (` 田中は ${ nextYearTanaka .age } 歳、佐藤は ${ nextYearSato .age } 歳` );
161+ document .write (
162+ ` 田中は ${ nextYearTanaka .age } 歳、佐藤は ${ nextYearSato .age } 歳` ,
163+ );
158164```
159165
160166<ViewSource url ={import.meta.url} path =" _samples/incrementAge " />
You can’t perform that action at this time.
0 commit comments