在这里插入图片描述
可以作为函数的参数, 进行传参
在这里插入图片描述
练习:
- <!DOCTYPE html>
- <HTML lang="zh">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0"
- />
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
- <title>
- Document
- </title>
- <script type="text/javascript">
- function acv() {
- alert("欢迎来到 Camel 的博客空间");
- }
- function show(a, fl) {
- console.log(a);
- fl();
- }
- show(8, acv);
- </script>
- </head>
- <body>
- </body>
- </HTML>
来源: http://www.jianshu.com/p/93d9977713bf