TypeScript เบื้องต้น – 3. Type Annotation vs Type Inference

type annotation คือกำหนด type ให้ตัวแปร, array , constant , object , function

let num : number

อันนี้เป็นการกำหนดให้เป็น number, แต่จะให้ค่าเป็น string ไม่ได้ num = “hello” ไม่ได้

Type Inference and Type Annotations in TypeScript


แยกระหว่าง type inferenece vs type annotation

Discover more from อรรถพรคลินิก ศัลยกรรมตกแต่ง Attaporn Plastic Surgery clinic 阿塔蓬博士,曼谷整形外科医生

Subscribe now to keep reading and get access to the full archive.

Continue reading