Skip to content · ⁨דלג לתוכן⁩

Arrow functions · ⁨פונקציות חצים⁩

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 או ב-{ }.

אותה פונקציה כתובה בשתי דרכים: הצורה הארוכה, וצורת החץ הקצרה

Log in or create account · ⁨היכנס או צור חשבון⁩

IGCSE, A-Level & AP