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:
26
03-javascript-core/04-loops/README.md
Normal file
26
03-javascript-core/04-loops/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# 练习 4:循环
|
||||
|
||||
## 目标
|
||||
|
||||
学会用循环处理重复任务,而不是手写很多遍。
|
||||
|
||||
## 你要练什么
|
||||
|
||||
- `for`
|
||||
- `while`
|
||||
- 累加
|
||||
- 条件跳过
|
||||
|
||||
## 任务
|
||||
|
||||
请完成一个“学习打卡统计”脚本,要求:
|
||||
|
||||
- 用 `for` 输出第 1 天到第 7 天的打卡信息
|
||||
- 跳过第 4 天
|
||||
- 再用 `while` 计算 1 到 5 的总和
|
||||
- 输出最终总和
|
||||
|
||||
## 文件
|
||||
|
||||
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/04-loops/starter.js)
|
||||
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/04-loops/answer.js)
|
||||
Reference in New Issue
Block a user