⚡ JavaScript - ES6

共 52 道题目

#1 初级

ES6 新增了哪个基本数据类型?它有什么特点?

What new primitive data type was added in ES6? What are its characteristics?

**What new primitive data type was added in ES6? What are its characteristics?**
- *考察点:基础知识的掌握。*
#2 初级

let、const 和 var 有什么区别?

What are the differences between let, const and var?

**What are the differences between let, const and var?**
- *考察点:变量声明方式和作用域。*
#3 初级

什么是块级作用域?ES6 如何实现?

What is block scope? How does ES6 implement it?

**What is block scope? How does ES6 implement it?**
- *考察点:作用域理解与变量生命周期。*
#4 初级

箭头函数与普通函数的区别是什么?

What are the differences between arrow functions and regular functions?

**What are the differences between arrow functions and regular functions?**
- *考察点:语法特性与 this 指向。*
#5 初级

什么是模板字符串?有哪些用法?

What are template strings? What are their uses?

**What are template strings? What are their uses?**
- *考察点:字符串拼接与表达式插值。*
#6 初级

解构赋值是什么?可以用于哪些数据类型?

What is destructuring assignment? What data types can it be used with?

**What is destructuring assignment? What data types can it be used with?**
- *考察点:数组、对象解构语法。*
#7 初级

ES6 如何声明默认参数?与 ES5 有何不同?

How does ES6 declare default parameters? How is it different from ES5?

**How does ES6 declare default parameters? How is it different from ES5?**
- *考察点:函数参数默认值。*
#8 初级

什么是扩展运算符(...)?常见应用场景有哪些?

What is the spread operator (...)? What are its common use cases?

**What is the spread operator (...)? What are its common use cases?**
- *考察点:数组、对象、函数参数等。*
#9 初级

ES6 如何声明多行字符串?

How does ES6 declare multi-line strings?

**How does ES6 declare multi-line strings?**
- *考察点:模板字符串语法。*
#10 初级

for...of 和 for...in 有什么区别?

What are the differences between for...of and for...in?

**What are the differences between for...of and for...in?**
- *考察点:遍历对象与数组的方式。*
#11 初级

什么是 Map 和 Set?与 Object、Array 有何区别?

What are Map and Set? How do they differ from Object and Array?

**What are Map and Set? How do they differ from Object and Array?**
- *考察点:新数据结构的理解。*
#12 初级

ES6 如何简化对象属性和方法的声明?

How does ES6 simplify object property and method declarations?

**How does ES6 simplify object property and method declarations?**
- *考察点:对象字面量增强写法。*
#13 初级

什么是 Symbol?有哪些应用场景?

What is Symbol? What are its application scenarios?

**What is Symbol? What are its application scenarios?**
- *考察点:唯一性、隐藏属性等。*
#14 初级

ES6 如何实现类(Class)?与 ES5 构造函数有何不同?

How does ES6 implement classes? How is it different from ES5 constructor functions?

**How does ES6 implement classes? How is it different from ES5 constructor functions?**
- *考察点:面向对象语法。*
#15 初级

什么是模块化?ES6 如何导入和导出模块?

What is modularization? How does ES6 import and export modules?

**What is modularization? How does ES6 import and export modules?**
- *考察点:import/export 语法。*
#16 初级

什么是 Promise?它有哪三种状态?

What is a Promise? What are its three states?

**What is a Promise? What are its three states?**
- *考察点:异步编程基础概念。*
#17 初级

ES6 为 Array 新增了哪些常用方法?

What new common methods did ES6 add to Array?

**What new common methods did ES6 add to Array?**
- *考察点:数组操作API。*
#18 初级

ES6 为 String 新增了哪些常用方法?

What new common methods did ES6 add to String?

**What new common methods did ES6 add to String?**
- *考察点:字符串处理API。*
#19 初级

const 声明的变量真的不可变吗?请举例说明。

**Are variables declared with const really immutable? Please give examples.**
- *考察点:const 的特性和限制。*
#1 中级

请解释箭头函数的 this 指向规则。

**Please explain the 'this' binding rules of arrow functions.**
- *考察点:词法作用域与上下文绑定。*
#2 中级

什么是 Promise?它解决了什么问题?

What is Promise? What problems does it solve?

**What is Promise? What problems does it solve?**
- *考察点:异步编程与回调地狱。*
#3 中级

如何实现一个简单的 Promise?

How to implement a simple Promise?

**How to implement a simple Promise?**
- *考察点:状态机与异步控制。*
#4 中级

什么是生成器(Generator)?如何使用?

What is a Generator? How to use it?

**What is a Generator? How to use it?**
- *考察点:函数暂停与迭代器协议。*
#5 中级

ES6 的类继承是如何实现的?super 关键字有什么作用?

How is class inheritance implemented in ES6? What is the role of the super keyword?

**How is class inheritance implemented in ES6? What is the role of the super keyword?**
- *考察点:原型链与构造函数继承。*
#6 中级

什么是 Proxy?可以实现哪些功能?

What is Proxy? What functions can it implement?

**What is Proxy? What functions can it implement?**
- *考察点:对象代理与元编程。*
#7 中级

什么是迭代器(Iterator)?如何自定义一个迭代器?

What is an Iterator? How to customize an iterator?

**What is an Iterator? How to customize an iterator?**
- *考察点:遍历协议与 Symbol.iterator。*
#8 中级

Set 和 Map 的常用方法有哪些?如何遍历?

What are the common methods of Set and Map? How to iterate through them?

**What are the common methods of Set and Map? How to iterate through them?**
- *考察点:API 熟悉度。*
#9 中级

什么是 WeakMap 和 WeakSet?它们的应用场景是什么?

What are WeakMap and WeakSet? What are their application scenarios?

**What are WeakMap and WeakSet? What are their application scenarios?**
- *考察点:内存管理与垃圾回收。*
#10 中级

ES6 如何实现对象的浅拷贝和深拷贝?

How does ES6 implement shallow copy and deep copy of objects?

**How does ES6 implement shallow copy and deep copy of objects?**
- *考察点:扩展运算符、Object.assign、递归。*
#11 中级

什么是 async/await?它与 Promise 有什么关系?

What is async/await? What is its relationship with Promise?

**What is async/await? What is its relationship with Promise?**
- *考察点:异步语法糖与错误处理。*
#12 中级

什么是模块的动态导入?如何使用?

What is dynamic import of modules? How to use it?

**What is dynamic import of modules? How to use it?**
- *考察点:import() 语法与懒加载。*
#13 中级

ES6 如何实现函数参数的剩余参数和展开参数?

How does ES6 implement rest parameters and spread parameters in function parameters?

**How does ES6 implement rest parameters and spread parameters in function parameters?**
- *考察点:...rest 与 ...spread。*
#14 中级

什么是解构赋值中的默认值?有哪些注意事项?

What are default values in destructuring assignment? What should be noted?

**What are default values in destructuring assignment? What should be noted?**
- *考察点:语法细节与边界情况。*
#15 中级

ES6 为 Object 新增了哪些常用方法?请举例说明。

What common methods did ES6 add to Object? Please give examples.

**What common methods did ES6 add to Object? Please give examples.**
- *考察点:对象操作API的掌握。*
#16 中级

如何在函数参数中使用解构赋值?有哪些高级用法?

How to use destructuring assignment in function parameters? What are the advanced uses?

**How to use destructuring assignment in function parameters? What are the advanced uses?**
- *考察点:函数参数解构的灵活应用。*
#17 中级

什么是尾调用优化?ES6 如何支持尾调用优化?

What is tail call optimization? How does ES6 support tail call optimization?

**What is tail call optimization? How does ES6 support tail call optimization?**
- *考察点:性能优化与函数调用机制。*
#1 高级

请解释 ES6 的事件循环机制及微任务、宏任务的执行顺序。

**Please explain ES6's event loop mechanism and the execution order of microtasks and macrotasks.**
- *考察点:异步执行模型与优先级。*
#2 高级

如何实现一个完整的 Promise/A+ 规范的 Promise?

How to implement a complete Promise/A+ specification compliant Promise?

**How to implement a complete Promise/A+ specification compliant Promise?**
- *考察点:状态管理与链式调用。*
#3 高级

Generator 与 async/await 的底层原理是什么?

What are the underlying principles of Generator and async/await?

**What are the underlying principles of Generator and async/await?**
- *考察点:协程、自动化流程控制。*
#4 高级

Proxy 可以实现哪些高级场景?请举例说明。

What advanced scenarios can Proxy implement? Please give examples.

**What advanced scenarios can Proxy implement? Please give examples.**
- *考察点:数据劫持、响应式、AOP。*
#5 高级

Symbol 的高级应用:如何用于实现单例模式和自定义迭代器?

**Advanced applications of Symbol: How to use it to implement singleton pattern and custom iterators?**
- *考察点:Symbol的唯一性、隐藏属性、以及在设计模式中的应用。*
#6 高级

如何实现一个简单的响应式系统(如 Vue3 响应式原理)?

How to implement a simple reactive system (like Vue3 reactivity principle)?

**How to implement a simple reactive system (like Vue3 reactivity principle)?**
- *考察点:Proxy、依赖收集、数据劫持。*
#7 高级

ES6 的模块化与 CommonJS 有哪些区别?如何兼容?

What are the differences between ES6 modules and CommonJS? How to make them compatible?

**What are the differences between ES6 modules and CommonJS? How to make them compatible?**
- *考察点:静态/动态加载、导入导出机制。*
#8 高级

如何实现一个异步迭代器?应用场景有哪些?

How to implement an async iterator? What are the application scenarios?

**How to implement an async iterator? What are the application scenarios?**
- *考察点:Symbol.asyncIterator、for await...of。*
#9 高级

Reflect API 有哪些常用方法?与 Proxy 有何关系?

What are the common methods of Reflect API? What is its relationship with Proxy?

**What are the common methods of Reflect API? What is its relationship with Proxy?**
- *考察点:元编程与对象操作。*
#10 高级

ES6 如何优化性能?有哪些新特性有助于性能提升?

How does ES6 optimize performance? What new features help improve performance?

**How does ES6 optimize performance? What new features help improve performance?**
- *考察点:尾调用优化、懒加载、数据结构选择。*
#11 高级

如何实现一个简单的模板引擎(支持插值表达式)?

How to implement a simple template engine (supporting interpolation expressions)?

**How to implement a simple template engine (supporting interpolation expressions)?**
- *考察点:字符串处理与正则表达式。*
#12 高级

ES6 如何处理循环引用?有哪些解决方案?

How does ES6 handle circular references? What are the solutions?

**How does ES6 handle circular references? What are the solutions?**
- *考察点:WeakMap、序列化算法。*
#13 高级

如何实现一个类的 mixin?有哪些注意事项?

How to implement class mixins? What should be noted?

**How to implement class mixins? What should be noted?**
- *考察点:对象合成与继承。*
#14 高级

ES6 如何实现私有方法和私有属性?有哪些限制?

How does ES6 implement private methods and properties? What are the limitations?

**How does ES6 implement private methods and properties? What are the limitations?**
- *考察点:#语法、闭包、Symbol、WeakMap等多种实现方式。*
#15 高级

如何实现一个异步队列?应用场景有哪些?

How to implement an async queue? What are the application scenarios?

**How to implement an async queue? What are the application scenarios?**
- *考察点:Promise、Generator、事件循环。*
#16 高级

如何用 Proxy 实现数据校验和自动格式化?

How to use Proxy to implement data validation and automatic formatting?

**How to use Proxy to implement data validation and automatic formatting?**
- *考察点:拦截器与数据处理。*

---