Primitive Wrappers
TypeScript มี primitive types (ตัวพิมพ์เล็ก) และ wrapper objects (ตัวพิมพ์ใหญ่) ที่ดูคล้ายกันแต่ทำงานต่างกันมาก ควรใช้ primitives เท่านั้นเพื่อหลีกเลี่ยงปัญหา
เปรียบเทียบ Primitive vs Wrapper
Section titled “เปรียบเทียบ Primitive vs Wrapper”| Primitive (ใช้) | Wrapper (หลีกเลี่ยง) | คำอธิบาย |
|---|---|---|
string | String | ข้อความ |
number | Number | ตัวเลข |
boolean | Boolean | true/false |
symbol | Symbol | unique identifier |
bigint | BigInt | ตัวเลขใหญ่ |
Primitive vs Wrapper
Section titled “Primitive vs Wrapper”เข้าสู่ระบบเพื่อดูเนื้อหาเต็ม
ยืนยันตัวตนด้วยบัญชี Google เพื่อปลดล็อกบทความทั้งหมด
Login with Google