TypeScript hiện đại: từ cơ bản đến nâng cao (TS 6 & 7)›2. Kiểu cơ bảnQuiz: Kiểu cơ bảnKiểm tra kiến thức về các kiểu cơ bản.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àoCả baQuestion 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ả haiKhông đoạn nàoQuestion 7.`any``unknown``object``never`Question 8.`number``number | undefined``undefined`Lỗi biên dịchQuestion 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 Mark as completed← PreviousNext →Comments
Comments