- 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
657 B
Markdown
27 lines
657 B
Markdown
# 练习 8:常见内置方法
|
||
|
||
## 目标
|
||
|
||
学会使用几个常见的字符串和数组方法,减少重复代码。
|
||
|
||
## 你要练什么
|
||
|
||
- `trim()`
|
||
- `toUpperCase()`
|
||
- `includes()`
|
||
- `join()`
|
||
|
||
## 任务
|
||
|
||
请完成一个“标签清洗器”脚本,要求:
|
||
|
||
- 把一段带空格的文本去掉首尾空格
|
||
- 把结果转成大写
|
||
- 判断里面是否包含 `JS`
|
||
- 把一个标签数组拼成一个字符串输出
|
||
|
||
## 文件
|
||
|
||
- [starter.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/08-built-in-methods/starter.js)
|
||
- [answer.js](/Users/lijiaqing/home/wwwroot/front-end-example/03-javascript-core/08-built-in-methods/answer.js)
|