「JavaScript」アロー関数のサンプル
書式
変数名 = (変数1, 変数2) => 変数1 * 変数2;
使用例
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript アロー関数のサンプル</h2>
<p id="demo"></p>
<script>
const x = (a, b) => a * b;
document.getElementById("demo").innerHTML = x(5, 6);
</script>
</body>
</html>