1 代码示例

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <script>
  8. // 定义函数关键字function
  9. function fnSum(num1, num2){
  10. var ret = num1 + num2;
  11. return ret;
  12. }
  13. var ret = fnSum(23,3)
  14. alert(ret);
  15. </script>
  16. </head>
  17. <body>
  18. </body>
  19. </html>

image.png