LoginSignup
0
0

More than 5 years have passed since last update.

複数の数値が定義されている配列dataから、「100」と「40」の値を取り出し、2つの値を合算し表示するプログラムを作成

Posted at
<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="UTF-8">
    <title>4_9</title>
    <script>
        var data = [59, 39, 100, 2, 15, 40, 84, 97];
        for (var i = 0; i < data.length; i++) {
        }
        document.write(data[2] + ' + ' + data[5] + ' = ' + (data[2]+data[5]));
    </script>
</head>
<body>
</body>
</html>

100 + 40 = 140

0
0
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
0
0