Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const user = {
name: "山田花子",
profile: "プログラミングを勉強しています。",
};

document.write(user.profile); // プログラミングを勉強しています。
user.profile = "JavaScriptでWebアプリを作っています。";
document.write(user.profile); // JavaScriptでWebアプリを作っています。
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const user = {
name: "山田花子",
bio: "プログラミングを勉強しています。",
profile: "プログラミングを勉強しています。",
};
16 changes: 8 additions & 8 deletions docs/1-trial-session/12-object/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ JavaScriptのオブジェクトは、ほかの言語でいう辞書や連想配
次のような情報を持つユーザーを表すオブジェクト`user`を作成してください。

- `name`: `"山田花子"`
- `bio`: `"プログラミングを勉強しています。"`
- `profile`: `"プログラミングを勉強しています。"`

<Answer>

```javascript
const user = {
name: "山田花子",
bio: "プログラミングを勉強しています。",
profile: "プログラミングを勉強しています。",
};
```

Expand Down Expand Up @@ -92,19 +92,19 @@ document.write(student.email); // yamada.taro@example.jp
```javascript
const user = {
name: "山田花子",
bio: "プログラミングを勉強しています。",
profile: "プログラミングを勉強しています。",
};
```

<Answer>

```javascript
document.write(user.bio); // プログラミングを勉強しています。
user.bio = "JavaScriptでWebアプリを作っています。";
document.write(user.bio); // JavaScriptでWebアプリを作っています。
document.write(user.profile); // プログラミングを勉強しています。
user.profile = "JavaScriptでWebアプリを作っています。";
document.write(user.profile); // JavaScriptでWebアプリを作っています。
```

<ViewSource url={import.meta.url} path="_samples/change-bio-property" />
<ViewSource url={import.meta.url} path="_samples/change-profile-property" />

</Answer>

Expand Down Expand Up @@ -141,7 +141,7 @@ document.write(student.scores.math); // 100
```javascript
const user = {
name: "山田花子",
bio: "JavaScriptでWebアプリを作っています。",
profile: "JavaScriptでWebアプリを作っています。",
settings: {
isNotificationsEnabled: true,
language: "日本語",
Expand Down