diff --git a/docs/1-trial-session/11-object/_samples/incrementAge/script.js b/docs/1-trial-session/11-object/_samples/incrementAge/script.js index e2bb135fe..5df8084bd 100644 --- a/docs/1-trial-session/11-object/_samples/incrementAge/script.js +++ b/docs/1-trial-session/11-object/_samples/incrementAge/script.js @@ -4,5 +4,9 @@ function incrementAge(person) { } const tanaka = { name: "田中", age: 18 }; +const sato = { name: "佐藤", age: 22 }; const nextYearTanaka = incrementAge(tanaka); -document.write(nextYearTanaka.age); +const nextYearSato = incrementAge(sato); +document.write( + `田中は ${nextYearTanaka.age} 歳、佐藤は ${nextYearSato.age} 歳`, +); diff --git a/docs/1-trial-session/11-object/index.mdx b/docs/1-trial-session/11-object/index.mdx index 65045b62a..4d9117cae 100644 --- a/docs/1-trial-session/11-object/index.mdx +++ b/docs/1-trial-session/11-object/index.mdx @@ -143,8 +143,13 @@ function incrementAge(person) { } const tanaka = { name: "田中", age: 18 }; +const sato = { name: "佐藤", age: 22 }; const nextYearTanaka = incrementAge(tanaka); -document.write(nextYearTanaka.age); // 19 と表示されてほしい +const nextYearSato = incrementAge(sato); +// 19 歳、23 歳 と表示されてほしい +document.write( + `田中は ${nextYearTanaka.age} 歳、佐藤は ${nextYearSato.age} 歳`, +); ``` @@ -156,8 +161,12 @@ function incrementAge(person) { } const tanaka = { name: "田中", age: 18 }; +const sato = { name: "佐藤", age: 22 }; const nextYearTanaka = incrementAge(tanaka); -document.write(nextYearTanaka.age); +const nextYearSato = incrementAge(sato); +document.write( + `田中は ${nextYearTanaka.age} 歳、佐藤は ${nextYearSato.age} 歳`, +); ```