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:
charlie
2026-03-13 11:09:19 +08:00
parent 4495ae0e28
commit 877acb5a8f
51 changed files with 1949 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
# 练习 5函数
## 目标
学会把一段逻辑封装成函数,并通过参数和返回值复用它。
## 你要练什么
- 函数声明
- 参数
- `return`
- 函数调用
## 任务
请完成一个“学习成绩处理器”,要求:
- 写一个 `getAverage` 函数
- 接收 3 个分数参数
- 返回平均分
- 再写一个 `getLevel` 函数
- 根据平均分返回“优秀”“良好”“继续努力”
## 文件
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/05-functions/starter.js)
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/05-functions/answer.js)