- 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.
练习 5:函数
目标
学会把一段逻辑封装成函数,并通过参数和返回值复用它。
你要练什么
- 函数声明
- 参数
return- 函数调用
任务
请完成一个“学习成绩处理器”,要求:
- 写一个
getAverage函数 - 接收 3 个分数参数
- 返回平均分
- 再写一个
getLevel函数 - 根据平均分返回“优秀”“良好”“继续努力”