Skip to content
IT Courses
Courses
Blog
Search
/
VI
Quiz: Kiểu cơ bản · TypeScript hiện đại: từ cơ bản đến nâng cao (TS 6 & 7)
Curriculum
›
2. Kiểu cơ bản
Quiz: Kiểu cơ bản
Mark as completed
← Previous
Next →
Comments
Question 1.
`a: string`, `b: string`
`a: "hello"`, `b: string`
`a: "hello"`, `b: "hello"`
`a: string`, `b: "hello"`
Question 2.
Chỉ (1)
(1) và (3)
Không dòng nào
Cả ba
Question 3.
`[number, number]`
`number[]`
`readonly [1, 2]`
`[1, 2]`
Question 4.
Select all correct answers.
`prices.push(1)`
`prices.sort()`
`prices.toSorted((a, b) => a - b)`
`prices[0] = 5`
Question 5.
Select all correct answers.
`u.toUpperCase();`
`if (typeof u === "string") u.toUpperCase();`
`const s: string = u;`
`const x: unknown = u;`
Question 6.
`req(o)`
`req({ timeout: 1, retry: 2 })`
Cả hai
Không đoạn nào
Question 7.
`any`
`unknown`
`object`
`never`
Question 8.
`number`
`number | undefined`
`undefined`
Lỗi biên dịch
Question 9.
`[string, string]`
`[level: string, ...messages: string[]]`
`[string, string?]`
`string[2]`
Question 10.
`void` và `unknown`
`never` và `never`
`undefined` và `string | number`
`Error` và `never`
Check
TypeScript hiện đại: từ cơ bản đến nâng cao (TS 6 & 7)
Kiểm tra kiến thức về các kiểu cơ bản.
Comments