Skip to content

Commit af5e57a

Browse files
authored
Merge pull request #580 from ut-code/replace-car-exercise-new
車の演習問題の修正
2 parents a050a8c + 74bfe9d commit af5e57a

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

docs/2-browser-apps/03-class/_samples/class-car/index.html renamed to docs/2-browser-apps/03-class/_samples/car-class/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="ja">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Title</title>
5+
<title>Car クラス</title>
66
</head>
77
<body>
88
<script src="./script.js"></script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Car {
2+
weightInTons = 1;
3+
cost;
4+
}
5+
6+
const prius = new Car();
7+
prius.cost = 2600000;
8+
9+
document.write(`重さは${prius.weightInTons}tで、値段は${prius.cost}円です。`);

docs/2-browser-apps/03-class/_samples/class-car/script.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/2-browser-apps/03-class/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ document.write(emptyFunction()); // 値を返さない関数の戻り値は unde
6262

6363
### 課題
6464

65-
`weight``cost` をプロパティとして持ち、 `weight` のデフォルト値が `"1t"` であるクラス `Car` を作成し、 `cost` に好きな値を代入してみましょう。
65+
`weightInTons``cost` をプロパティとして持ち、 `weightInTons` のデフォルト値が `1` であるクラス `Car` を作成し、 `cost` に好きな値を代入してみましょう。
6666

67-
<ViewSource url={import.meta.url} path="_samples/class-car" />
67+
<ViewSource url={import.meta.url} path="_samples/car-class" />
6868

6969
## <Term>メソッド</Term>
7070

0 commit comments

Comments
 (0)