Skip to content · ⁨コンテンツへスキップ⁩
English

Arrow functions

  • A shorter way to write a function: const square = (n) => n * n;.
  • With a single expression after =>, the value is returned automatically — no return, no { }.

日本語

アロー関数

  • 関数を簡潔に書く方法: const square = (n) => n * n; 。
  • => の後に単一の式がある場合、自動的に値が返され、return も { } も不要です。

同じ関数を2つの形式で書いた例:長い形式と短いアロー形式

Log in or create account · ⁨ログインまたはアカウント作成⁩

IGCSE, A-Level & AP