⚡ JavaScript - ES5

共 53 道题目

#1 初级

JavaScript 中有哪些基本数据类型 (Primitive Types)?

What are the primitive data types in JavaScript?

**What are the primitive data types in JavaScript?**
- *考察点:基础知识的掌握。*
#2 初级

== 和 === 有什么区别?

What is the difference between == and ===?

**What is the difference between == and ===?**
- *考察点:对类型转换和严格比较的理解。*
#3 初级

什么是作用域 (Scope)?JavaScript 中的作用域有几种?

What is scope? How many types of scope are there in JavaScript?

**What is scope? How many types of scope are there in JavaScript?**
- *考察点:对变量可访问性规则的理解。*
#4 初级

什么是变量提升 (Hoisting)?

What is hoisting?

**What is hoisting?**
- *考察点:对 JavaScript 代码执行顺序的理解。*
#5 初级

typeof 操作符的返回值有哪些?

What are the possible return values of the typeof operator?

**What are the possible return values of the typeof operator?**
- *考察点:对数据类型检测方法的掌握。*
#6 初级

null 和 undefined 的区别是什么?

What is the difference between null and undefined?

**What is the difference between null and undefined?**
- *考察点:对特殊值的理解和使用场景。*
#7 初级

什么是 falsy 值?JavaScript 中有哪些 falsy 值?

What are falsy values? What falsy values exist in JavaScript?

**What are falsy values? What falsy values exist in JavaScript?**
- *考察点:对布尔转换规则的理解。*
#8 初级

如何检测一个变量是否为数组?

How to detect if a variable is an array?

**How to detect if a variable is an array?**
- *考察点:数组检测方法的掌握。*
#9 初级

JavaScript 中的原始类型和引用类型有什么区别?

What is the difference between primitive types and reference types in JavaScript?

**What is the difference between primitive types and reference types in JavaScript?**
- *考察点:对内存分配和数据传递方式的理解。*
#10 初级

什么是函数声明和函数表达式?它们有什么区别?

What are function declarations and function expressions? What are their differences?

**What are function declarations and function expressions? What are their differences?**
- *考察点:对函数定义方式的理解。*
#11 初级

for...in 循环是做什么的?使用时需要注意什么?

What does the for...in loop do? What should be noted when using it?

**What does the for...in loop do? What should be noted when using it?**
- *考察点:对象遍历和原型链的基础理解。*
#12 初级

JavaScript 中的字符串是可变的吗?

**Are strings mutable in JavaScript?**
- *考察点:对字符串特性的理解。*
#13 初级

什么是 parseInt() 和 parseFloat()?它们的区别是什么?

What are parseInt() and parseFloat()? What are their differences?

**What are parseInt() and parseFloat()? What are their differences?**
- *考察点:数据类型转换方法的掌握。*
#14 初级

什么是全局变量?使用全局变量有什么问题?

What are global variables? What problems can arise from using global variables?

**What are global variables? What problems can arise from using global variables?**
- *考察点:变量作用域和代码质量意识。*
#15 初级

JavaScript 中如何创建对象?有哪些方式?

How to create objects in JavaScript? What methods are available?

**How to create objects in JavaScript? What methods are available?**
- *考察点:对象创建方法的基础掌握。*
#1 中级

请解释 this 关键字在不同场景下的指向。

**Please explain how the 'this' keyword behaves in different scenarios.**
- *考察点:JavaScript 中最核心也最复杂的概念之一。*
#2 中级

什么是闭包 (Closure)?它的应用场景有哪些?有什么缺点?

What is a closure? What are its use cases? What are its drawbacks?

**What is a closure? What are its use cases? What are its drawbacks?**
- *考察点:对词法作用域、内存管理和高级函数应用的理解。*
#3 中级

请解释原型 (Prototype) 和原型链 (Prototype Chain)。

**Please explain prototype and prototype chain.**
- *考察点:对 JavaScript 面向对象核心——原型继承的理解。*
#4 中级

如何实现一个 bind 函数?

How to implement a bind function?

**How to implement a bind function?**
- *考察点:综合运用 this、apply、闭包和高阶函数等知识,代码实现能力。*
#5 中级

call、apply 和 bind 的区别是什么?

What are the differences between call, apply, and bind?

**What are the differences between call, apply, and bind?**
- *考察点:函数调用方式和上下文绑定的理解。*
#6 中级

什么是作用域链 (Scope Chain)?它是如何工作的?

What is the scope chain? How does it work?

**What is the scope chain? How does it work?**
- *考察点:对变量查找机制和执行上下文的理解。*
#7 中级

什么是立即执行函数表达式 (IIFE)?它的作用是什么?

What is an Immediately Invoked Function Expression (IIFE)? What is its purpose?

**What is an Immediately Invoked Function Expression (IIFE)? What is its purpose?**
- *考察点:模块化和作用域隔离的理解。*
#8 中级

JavaScript 中的继承有哪些实现方式?

What are the different ways to implement inheritance in JavaScript?

**What are the different ways to implement inheritance in JavaScript?**
- *考察点:面向对象编程和继承模式的掌握。*
#9 中级

什么是构造函数?new 操作符做了什么?

What is a constructor function? What does the 'new' operator do?

**What is a constructor function? What does the 'new' operator do?**
- *考察点:对象创建过程和构造函数原理的理解。*
#10 中级

如何实现深拷贝?

How to implement deep copy?

**How to implement deep copy?**
- *考察点:对象复制和递归算法的理解。*
#11 中级

什么是函数式编程?JavaScript 中如何实现?

What is functional programming? How to implement it in JavaScript?

**What is functional programming? How to implement it in JavaScript?**
- *考察点:编程范式和高阶函数的理解。*
#12 中级

什么是柯里化 (Currying)?如何实现?

What is currying? How to implement it?

**What is currying? How to implement it?**
- *考察点:函数式编程技巧和闭包应用。*
#13 中级

什么是防抖 (Debounce) 和节流 (Throttle)?如何实现?

What are debounce and throttle? How to implement them?

**What are debounce and throttle? How to implement them?**
- *考察点:性能优化和事件处理的理解。*
#14 中级

JavaScript 中的垃圾回收机制是什么?

What is the garbage collection mechanism in JavaScript?

**What is the garbage collection mechanism in JavaScript?**
- *考察点:内存管理和性能优化的理解。*
#15 中级

什么是执行上下文 (Execution Context)?

What is execution context?

**What is execution context?**
- *考察点:代码执行机制的深入理解。*
#16 中级

什么是变量对象 (Variable Object) 和活动对象 (Activation Object)?

What are Variable Object (VO) and Activation Object (AO)?

**What are Variable Object (VO) and Activation Object (AO)?**
- *考察点:执行上下文内部机制的理解。*
#17 中级

严格模式 (Strict Mode) 是什么?有什么作用?

What is strict mode? What is its purpose?

**What is strict mode? What is its purpose?**
- *考察点:代码质量和语言特性的理解。*
#18 中级

如何检测对象的属性是否存在?有哪些方法?

How to detect if an object property exists? What methods are available?

**How to detect if an object property exists? What methods are available?**
- *考察点:对象属性操作和原型链的理解。*
#1 高级

请解释 JavaScript 的事件循环 (Event Loop) 机制。

**Please explain the JavaScript Event Loop mechanism.**
- *考察点:对 JavaScript 异步执行模型的宏观理解。*
#2 高级

在 ES5 中,你如何处理异步操作(例如,多个有依赖关系的 Ajax 请求)?

How do you handle asynchronous operations in ES5 (for example, multiple dependent Ajax requests)?

**How do you handle asynchronous operations in ES5 (for example, multiple dependent Ajax requests)?**
- *考察点:对传统异步解决方案(回调)及其问题的理解。*
#3 高级

什么是"回调地狱 (Callback Hell)"?如何解决它?

What is "Callback Hell"? How to solve it?

**What is "Callback Hell"? How to solve it?**
- *考察点:同上,但更侧重于问题的识别和解决方案。*
#4 高级

常见的内存泄漏场景有哪些?

What are the common memory leak scenarios?

**What are the common memory leak scenarios?**
- *考察点:对内存管理和性能优化的实战经验。*
#5 高级

什么是宏任务 (Macro Task) 和微任务 (Micro Task)?它们的执行顺序是什么?

What are macro tasks and micro tasks? What is their execution order?

**What are macro tasks and micro tasks? What is their execution order?**
- *考察点:事件循环的深入理解和异步任务优先级。*
#6 高级

如何实现一个完整的 Promise(ES5 语法)?

How to implement a complete Promise (using ES5 syntax)?

**How to implement a complete Promise (using ES5 syntax)?**
- *考察点:异步编程原理和状态机的实现。*
#7 高级

什么是模块化?ES5 中如何实现模块化?

What is modularization? How to implement modules in ES5?

**What is modularization? How to implement modules in ES5?**
- *考察点:代码组织和命名空间管理。*
#8 高级

如何实现一个观察者模式 (Observer Pattern)?

How to implement the Observer pattern?

**How to implement the Observer pattern?**
- *考察点:设计模式和事件驱动编程。*
#9 高级

如何实现一个发布订阅模式 (Pub/Sub Pattern)?

How to implement the Publish-Subscribe pattern?

**How to implement the Publish-Subscribe pattern?**
- *考察点:解耦和事件通信机制。*
#10 高级

什么是单例模式?如何在 JavaScript 中实现?

What is the Singleton pattern? How to implement it in JavaScript?

**What is the Singleton pattern? How to implement it in JavaScript?**
- *考察点:设计模式和对象创建控制。*
#11 高级

如何实现一个简单的 MVC 框架?

How to implement a simple MVC framework?

**How to implement a simple MVC framework?**
- *考察点:架构设计和代码组织能力。*
#12 高级

JavaScript 中的性能优化有哪些方法?

What are the performance optimization methods in JavaScript?

**What are the performance optimization methods in JavaScript?**
- *考察点:实际项目经验和性能调优。*
#13 高级

什么是函数记忆化 (Memoization)?如何实现?

What is memoization? How to implement it?

**What is memoization? How to implement it?**
- *考察点:缓存优化和算法改进。*
#14 高级

如何实现一个 JSON.stringify?

How to implement JSON.stringify?

**How to implement JSON.stringify?**
- *考察点:数据序列化和递归算法。*
#15 高级

如何实现一个 JSON.parse?

How to implement JSON.parse?

**How to implement JSON.parse?**
- *考察点:字符串解析和状态机设计。*
#16 高级

什么是尾调用优化?JavaScript 中如何避免栈溢出?

What is tail call optimization? How to avoid stack overflow in JavaScript?

**What is tail call optimization? How to avoid stack overflow in JavaScript?**
- *考察点:递归优化和内存管理。*
#17 高级

如何实现一个简单的模板引擎?

How to implement a simple template engine?

**How to implement a simple template engine?**
- *考察点:字符串处理和代码生成。*
#18 高级

什么是沙箱环境?如何实现 JavaScript 代码沙箱?

What is a sandbox environment? How to implement a JavaScript sandbox?

**What is a sandbox environment? How to implement a JavaScript sandbox?**
- *考察点:安全编程和代码隔离。*
#19 高级

如何检测和处理循环引用?

How to detect and handle circular references?

**How to detect and handle circular references?**
- *考察点:复杂数据结构处理和算法设计。*
#20 高级

什么是代理模式?如何在 ES5 中模拟实现?

What is the Proxy pattern? How to simulate it in ES5?

**What is the Proxy pattern? How to simulate it in ES5?**
- *考察点:设计模式和对象行为控制。*

---