【JavaScript】JavaScriptをmodule化する方法

<!DOCTYPE html>
<html>
  <head>
    <title>Parcel Sandbox</title>
    <meta charset="UTF-8" />
  </head>

  <body>
    <script type="module">//module化
      const name = "AAA";
    </script>
    <script type="module">//module化
      const name = "BBB";
      document.body.textContent = name;
    </script>
  </body>
</html>
(Visited 9 times, 1 visits today)

コメントする

メールアドレスが公開されることはありません。 が付いている欄は必須項目です