feat: Add JavaScript core exercises and solutions
- Implemented exercises for array high-order methods, memory and execution, switch statements, and final review. - Added starter and answer files for each exercise to facilitate learning. - Created a runner HTML file to execute JavaScript code and display console outputs. - Updated README files to include exercise objectives, tasks, and usage instructions.
This commit is contained in:
11
03-javascript-core/09-scope-and-closure/starter.js
Normal file
11
03-javascript-core/09-scope-and-closure/starter.js
Normal file
@@ -0,0 +1,11 @@
|
||||
function createCounter() {
|
||||
let count = 0;
|
||||
|
||||
// 返回一个函数
|
||||
}
|
||||
|
||||
// 任务:
|
||||
// 1. 创建 counterA 和 counterB
|
||||
// 2. 连续调用 counterA 两次
|
||||
// 3. 再调用 counterB 一次
|
||||
// 4. 观察为什么两个计数器互不影响
|
||||
Reference in New Issue
Block a user