- 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.
练习 14:内存和执行
目标
理解“值”和“引用”的区别,以及函数执行时数据为什么会变化。
你要练什么
- 基本类型复制
- 引用类型共享
- 函数执行顺序
- 参数传递
任务
请完成一个“数据变化观察”脚本,要求:
- 比较基本类型复制后是否互相影响
- 比较对象复制后是否互相影响
- 写两个函数观察执行顺序
- 写一个函数修改传入对象,观察外部对象为什么会变化