函数:是封装特定功能的代码块

1定义函数

  1. 1.定义函数
  2. function go (){
  3. console.log("hello world")
  4. }
  5. function 关键字 go 函数名 { }之间是代码块

2.调用函数

  1. go( )