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

810 B
Raw Blame History

练习 15switch、break 和空值判断

目标

学会在分支判断里使用 switch,并区分 undefinednull 这两种常见空值。

你要练什么

  • switch
  • break
  • undefined
  • null
  • 空值判断

任务

请完成一个“学习记录检查器”脚本,要求:

  • switch 根据学习状态输出不同说明
  • 观察 undefinednull 的区别
  • 用循环读取学习记录
  • 如果读到 undefinednull,立即用 break 停止循环
  • 输出停止前已经读取到的内容

文件