Skip to content

Commit 1b9218f

Browse files
committed
docs(types): edit types/function.toString
1 parent c80eedc commit 1b9218f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/types/function.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,15 @@ f.toString()
273273
// }
274274
```
275275

276+
对于那些原生的函数,`toString()`方法返回`function (){[native code]}`
277+
278+
```javascript
279+
Math.sqrt.toString()
280+
// "function sqrt() { [native code] }"
281+
```
282+
283+
上面代码中,`Math.sqrt`是 JavaScript 引擎提供的原生函数,`toString()`方法就返回原生代码的提示。
284+
276285
函数内部的注释也可以返回。
277286

278287
```javascript

0 commit comments

Comments
 (0)