doc: create definition function section

This commit is contained in:
Leon Xu committed 2021-08-27 13:08:25 -07:00
1 parent 4f8d8ce6ef
commit ebe275bd52
1 file changed
+16 -1
+16 -1
View File
@@ -144,4 +144,19 @@ let stringedCount = "" + count; // "10"
let puppyCount = count + " puppies, yay!"; // "10 puppies, yay!"
let magicNum = parseInt("42 is the answer"); // 42
let mystery = parseFloat("Am I a number?"); // NaN
```
```
## 定义函数
```javascript
function name(params) {
statement;
statement;
···
statement;
}
// example
function myFunction() {
console.log("Hello!");
alert("Your browser says hi!");
}