Skip to content
เข้าสู่ระบบ

Rest Parameters

Rest parameters รวม arguments หลายตัวเป็น array มีประโยชน์เมื่อไม่รู้จำนวน arguments ล่วงหน้า

FeatureRest ParametersSpread Arguments
PositionFunction definitionFunction call
Syntax...params: T[]fn(...array)
PurposeCollect argsSpread array

เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม

ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด