func ประกาศ ฟังชั่น ตามด้วยชื่อของฟังชั่น และตัวอาร์กูเมนต์
ใช้เครื่องหมาย -> ในการบอกชนิดของ return และค่าของรีเทริน์
ตัวอย่าง
-
func Hello(name:String) -> String{
-
return "Sawasdee Ka (name)“ }
-
Hello("David”)
Life does not come with instructions on how to live, but it does come with trees, sunsets, smiles and laughter, so enjoy your day.
ชีวิตไม่ได้มาพร้อมกับคู่มือการใช้ชีวิต
แต่ชีวิตมาพร้อมกับต้นไม้, พระอาทิตย์ตก, รอยยิ้มและเสียงหัวเราะ
―Debbie Shapiro
—
by
func ประกาศ ฟังชั่น ตามด้วยชื่อของฟังชั่น และตัวอาร์กูเมนต์
ใช้เครื่องหมาย -> ในการบอกชนิดของ return และค่าของรีเทริน์
ตัวอย่าง
func Hello(name:String) -> String{
return "Sawasdee Ka (name)“ }
Hello("David”)