Files
charlie 877acb5a8f 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.
2026-03-13 11:09:19 +08:00

28 lines
650 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 练习 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)