ENع
الدرس 04 · Typing JavaScript

Typing functions

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A function is a small machine: values go in, one value comes out. Follow area(w, h) as its two parameters get types, the call area(3, 4) fills the slots and returns 12, and tsc catches a wrong return and a missing argument before anything runs. Then a default value, h = w, makes area(3) work and print 9.

10 دقيقة9 خطوات5 أسئلةBeginner
شكل 4 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.