Files
front-end-example/03-javascript-core/15-switch-break-and-empty-values/README.md
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

29 lines
810 B
Markdown
Raw 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.

# 练习 15switch、break 和空值判断
## 目标
学会在分支判断里使用 `switch`,并区分 `undefined``null` 这两种常见空值。
## 你要练什么
- `switch`
- `break`
- `undefined`
- `null`
- 空值判断
## 任务
请完成一个“学习记录检查器”脚本,要求:
-`switch` 根据学习状态输出不同说明
- 观察 `undefined``null` 的区别
- 用循环读取学习记录
- 如果读到 `undefined``null`,立即用 `break` 停止循环
- 输出停止前已经读取到的内容
## 文件
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/15-switch-break-and-empty-values/starter.js)
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/15-switch-break-and-empty-values/answer.js)