⚡ JavaScript - TYPESCRIPT

共 36 道题目

#1 初级

TypeScript 和 JavaScript 的区别是什么?

What are the differences between TypeScript and JavaScript?

**What are the differences between TypeScript and JavaScript?**
- *考察点:对 TypeScript 基本概念和语言特性的理解。*
#2 初级

TypeScript 的基本数据类型有哪些?

What are the basic data types in TypeScript?

**What are the basic data types in TypeScript?**
- *考察点:对 TypeScript 类型系统基础的掌握程度。*
#3 初级

什么是类型注解?如何使用?

What are type annotations? How to use them?

**What are type annotations? How to use them?**
- *考察点:类型声明语法与实际应用。*
#4 初级

什么是类型推断?

What is type inference?

**What is type inference?**
- *考察点:类型推断机制理解。*
#5 初级

什么是接口(interface)?如何定义和使用?

What is an interface? How to define and use it?

**What is an interface? How to define and use it?**
- *考察点:接口概念与面向对象抽象能力。*
#6 初级

TypeScript 中的可选链操作符(?.)和空值合并操作符(??)如何使用?

How to use optional chaining operator (?.) and nullish coalescing operator (??) in TypeScript?

**How to use optional chaining operator (?.) and nullish coalescing operator (??) in TypeScript?**
- *考察点:安全访问语法与实际应用。*
#7 初级

TypeScript 中的枚举(enum)是什么?

What is enum in TypeScript?

**What is enum in TypeScript?**
- *考察点:枚举类型理解与使用场景。*
#8 初级

TypeScript 如何定义数组和元组?

How does TypeScript define arrays and tuples?

**How does TypeScript define arrays and tuples?**
- *考察点:数组与元组类型区别和应用。*
#9 初级

什么是联合类型(Union Types)和交叉类型(Intersection Types)?

What are Union Types and Intersection Types?

**What are Union Types and Intersection Types?**
- *考察点:复合类型理解与实际应用。*
#10 初级

TypeScript 中的类型别名(type alias)是什么?

What is type alias in TypeScript?

**What is type alias in TypeScript?**
- *考察点:类型别名概念与应用场景。*
#11 初级

如何在 TypeScript 中定义函数类型?

How to define function types in TypeScript?

**How to define function types in TypeScript?**
- *考察点:函数类型声明方式与应用。*
#12 初级

TypeScript 如何处理 JavaScript 文件?allowJs 配置的作用是什么?

How does TypeScript handle JavaScript files? What is the role of allowJs configuration?

**How does TypeScript handle JavaScript files? What is the role of allowJs configuration?**
- *考察点:TS 与 JS 混合开发理解。*
#1 中级

什么是类型断言(Type Assertion)?和类型转换的区别?

What is Type Assertion? What's the difference from type conversion?

**What is Type Assertion? What's the difference from type conversion?**
- *考察点:类型断言概念与区别。*
#2 中级

TypeScript 中的可选属性和只读属性怎么用?

How to use optional properties and readonly properties in TypeScript?

**How to use optional properties and readonly properties in TypeScript?**
- *考察点:对象属性修饰符理解与应用。*
#3 中级

什么是泛型(Generics)?如何使用泛型函数和泛型接口?

What are Generics? How to use generic functions and generic interfaces?

**What are Generics? How to use generic functions and generic interfaces?**
- *考察点:泛型编程思想与实际应用。*
#4 中级

什么是泛型约束(Generic Constraints)?如何使用 extends 关键字?

What are Generic Constraints? How to use the extends keyword?

**What are Generic Constraints? How to use the extends keyword?**
- *考察点:泛型约束机制与复杂场景处理。*
#5 中级

TypeScript 如何实现类的继承和接口的实现?

How does TypeScript implement class inheritance and interface implementation?

**How does TypeScript implement class inheritance and interface implementation?**
- *考察点:面向对象继承与接口实现机制。*
#6 中级

什么是命名空间(namespace)和模块(module)?

What are namespaces and modules?

**What are namespaces and modules?**
- *考察点:代码组织方式与最佳实践。*
#7 中级

TypeScript 的装饰器(Decorator)是什么?常见的装饰器类型有哪些?

What are decorators in TypeScript? What are the common types of decorators?

**What are decorators in TypeScript? What are the common types of decorators?**
- *考察点:装饰器模式与元编程能力。*
#8 中级

什么是类型守卫(Type Guard)?有哪些实现方式?

What are Type Guards? What are the implementation methods?

**What are Type Guards? What are the implementation methods?**
- *考察点:类型缩窄机制与运行时类型检查。*
#9 中级

TypeScript 如何与第三方 JavaScript 库集成?

How does TypeScript integrate with third-party JavaScript libraries?

**How does TypeScript integrate with third-party JavaScript libraries?**
- *考察点:类型声明文件与生态集成。*
#10 中级

什么是声明文件(.d.ts)?如何编写?

What are declaration files (.d.ts)? How to write them?

**What are declaration files (.d.ts)? How to write them?**
- *考察点:类型声明文件理解与编写能力。*
#11 中级

TypeScript 的编译选项(tsconfig.json)常用配置有哪些?

What are the common configurations in TypeScript compilation options (tsconfig.json)?

**What are the common configurations in TypeScript compilation options (tsconfig.json)?**
- *考察点:编译配置理解与项目搭建能力。*
#12 中级

TypeScript 的模块解析策略有哪些?如何配置路径映射?

What are TypeScript's module resolution strategies? How to configure path mapping?

**What are TypeScript's module resolution strategies? How to configure path mapping?**
- *考察点:模块系统与路径映射配置。*
#1 高级

什么是条件类型(Conditional Types)?举例说明

What are Conditional Types? Please give examples.

**What are Conditional Types? Please give examples.**
- *考察点:高级类型系统与类型编程能力。*
#2 高级

什么是映射类型(Mapped Types)?常见的内置映射类型有哪些?

What are Mapped Types? What are the common built-in mapped types?

**What are Mapped Types? What are the common built-in mapped types?**
- *考察点:映射类型理解与工具类型应用。*
#3 高级

什么是索引类型查询(keyof)和索引访问类型(T[K])?

What are index type queries (keyof) and indexed access types (T[K])?

**What are index type queries (keyof) and indexed access types (T[K])?**
- *考察点:类型索引操作与类型安全访问。*
#4 高级

infer 关键字的作用及使用场景?

What is the role of the infer keyword and its usage scenarios?

**What is the role of the infer keyword and its usage scenarios?**
- *考察点:类型推断与条件类型提取。*
#5 高级

如何实现类型体操(Type Challenges)?举例说明

How to implement Type Challenges? Please give examples.

**How to implement Type Challenges? Please give examples.**
- *考察点:类型系统深度掌握与类型编程技巧。*
#6 高级

TypeScript 的类型兼容性是如何判断的?

How is type compatibility determined in TypeScript?

**How is type compatibility determined in TypeScript?**
- *考察点:结构类型系统与兼容性规则。*
#7 高级

什么是 never 类型?有哪些应用场景?

What is the never type? What are its application scenarios?

**What is the never type? What are its application scenarios?**
- *考察点:底层类型理解与边界处理。*
#8 高级

TypeScript 如何实现类型安全的链式调用?

How does TypeScript implement type-safe method chaining?

**How does TypeScript implement type-safe method chaining?**
- *考察点:高级设计模式与类型安全 API 设计。*
#9 高级

如何实现一个深度只读(DeepReadonly)类型?

How to implement a DeepReadonly type?

**How to implement a DeepReadonly type?**
- *考察点:递归类型与映射类型综合应用。*
#10 高级

TypeScript 4.x 新增了哪些重要特性?

What important features were added in TypeScript 4.x?

**What important features were added in TypeScript 4.x?**
- *考察点:最新特性与技术发展趋势。*
#11 高级

什么是协变(Covariance)和逆变(Contravariance)?在 TypeScript 中如何体现?

What are Covariance and Contravariance? How are they reflected in TypeScript?

**What are Covariance and Contravariance? How are they reflected in TypeScript?**
- *考察点:型变概念与实际体现。*
#12 高级

如何在 TypeScript 中实现单例模式并确保类型安全?

How to implement the Singleton pattern in TypeScript while ensuring type safety?

**How to implement the Singleton pattern in TypeScript while ensuring type safety?**
- *考察点:设计模式实现与类型技巧综合应用。*