- 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.
810 B
810 B
练习 15:switch、break 和空值判断
目标
学会在分支判断里使用 switch,并区分 undefined、null 这两种常见空值。
你要练什么
switchbreakundefinednull- 空值判断
任务
请完成一个“学习记录检查器”脚本,要求:
- 用
switch根据学习状态输出不同说明 - 观察
undefined和null的区别 - 用循环读取学习记录
- 如果读到
undefined或null,立即用break停止循环 - 输出停止前已经读取到的内容