Skip to content
IT Courses
Courses
Blog
Search
/
VI
Quiz: Thao tác kiểu · TypeScript hiện đại: từ cơ bản đến nâng cao (TS 6 & 7)
Curriculum
›
8. Thao tác kiểu
Quiz: Thao tác kiểu
Mark as completed
← Previous
Next →
Comments
Question 1.
`string`
`"port" | "host"`
`number | string`
`{ port: number; host: string }`
Question 2.
`string`
`readonly string[]`
`"admin" | "editor"`
`number`
Question 3.
`(string | number)[]`
`string[] | number[]`
`never`
`unknown[]`
Question 4.
`true`
`false`
`never`
`boolean`
Question 5.
`A = string[]`, `B = number`
`A = string`, `B = never`
`A = Promise<string[]>`, `B = number`
`A = string[]`, `B = never`
Question 6.
`{ id: number; name?: string; readonly email: string }`
`{ id: number; name: string; email: string }`
`{ id?: number; name?: string; email?: string }`
`{ readonly id: number; readonly name: string; readonly email: string }`
Question 7.
`{ id: number; price: number }`
`{ name: string }`
`{ id: never; name: never; price: never }`
`"id" | "price"`
Question 8.
2
5
6
`string`
Question 9.
Select all correct answers.
`type A = Pick<User, "id" | "nam">;`
`type B = Omit<User, "nam">;`
`type C = Partial<Omit<User, "id">>;`
`type D = Record<"vi" | "en", User>;`
Question 10.
`Promise<number[]>`
`number[]`
`number`
`() => Promise<number[]>`
Check
TypeScript hiện đại: từ cơ bản đến nâng cao (TS 6 & 7)
Mỗi câu hỏi: kiểu này ra gì?
Comments