- 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.
27 lines
750 B
Markdown
27 lines
750 B
Markdown
# 练习 14:内存和执行
|
||
|
||
## 目标
|
||
|
||
理解“值”和“引用”的区别,以及函数执行时数据为什么会变化。
|
||
|
||
## 你要练什么
|
||
|
||
- 基本类型复制
|
||
- 引用类型共享
|
||
- 函数执行顺序
|
||
- 参数传递
|
||
|
||
## 任务
|
||
|
||
请完成一个“数据变化观察”脚本,要求:
|
||
|
||
- 比较基本类型复制后是否互相影响
|
||
- 比较对象复制后是否互相影响
|
||
- 写两个函数观察执行顺序
|
||
- 写一个函数修改传入对象,观察外部对象为什么会变化
|
||
|
||
## 文件
|
||
|
||
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/14-memory-and-execution/starter.js)
|
||
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/14-memory-and-execution/answer.js)
|