1
0
Fork 0
Obsidian 管理的个人笔记仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
514 B

- `12.toString()` 会报错,这是因为 JavaScript 允许10进制 Number 省略小数点前或者后,`12.toString()` 中的 `12.` 会被当作省略了小数点后的数字,如果想要这一句正常工作,需要在中间加个空格:`12 .toString()` 或是 `12..toString()`
- 模板支持添加处理函数的写法,这时模板的各段会被拆开,传递给函数当参数:
```javascript
function f(){
console.log(arguments);
}
var a = "world"
f`Hello ${a}!`; // [["Hello", "!"], world]
```