1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

繰り返し処理を利用し、九九を作成

Last updated at Posted at 2018-11-29
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <title>九九</title>
</head>
<body>
    <script>
        for (let i = 1; i<= 9; i++) {
            for (let j = 1; j<= 9; j++) {
                document.write(`${i} * ${j} = ${i*j}<br />`);
            }
        }
    </script>
</body>
</html>

#1週間前からJavascriptを勉強しているのだが、
#どうやらES2015というものがあるらしく、親切に教えてもらった。

-```
+```html
<!DOCTYPE html>
<html lang="ja">
<head>
 <meta charset="UTF-8">
 <title>九九</title>
</head>
<body>
 <script>
- for (var i = 1; i<= 9; i++) {
- for (var j = 1; j<= 9; j++) {
- var mult = i*j;
- document.write(i + " * " + j + " = " + mult + "<br />");
+ for (let i = 1; i<= 9; i++) {
+ for (let j = 1; j<= 9; j++) {
+ document.write(`${i} * ${j} = ${i*j}<br />`);
 }
 }
 </script>
</body>
</html>

- 以下が、削除推奨
+ 以下が、添削部分
私が学んでいるのは、古いバージョンのような。
これは、勉強しなおさないと、いけないのか? 軽くショックだ。。。。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?