แล้วรันด้วย tsc จะเกิด Type Error ขึ้น พร้อมกับแจ้งว่ามีปัญหาที่จุดไหน
$ tsc hello.ts
hello.ts:7:47 - error TS2551: Property 'lastname'
does not exist on type '{ firstName: string; lastName: string; job: string; }'.
Did you mean 'lastName'?
7 console.log(`ฉันชื่อ ${user.firstName} ${user.lastname}`)
~~~~~~~~
index.ts:3:3
3 lastName: "จานโอชา",
~~~~~~~~~~~~~~~~~~~
'lastName' is declared here.
Found 1 error.