モダンなフロントエンドの現場では、ES2015以降のJavaScriptの構文を使うことがほとんどです。たとえば次に示すコードでは、ES2015で導入されたアロー関数やES Modulesを使っています。 ▼ index.js import { myFunction } from "./myFunction.js"; const todayWeather = myFunction(14); document .querySelector("#weather") .textContent = todayWeather; ▼ myFunction.js export const myFunction = temperature => { return `岡山県の気温は${temperature}度です`; }; ES2015以降の構文はブラウザーによっては対応していないこともあるため、Babe
