如果输出语句只有一段return,可以省略return

  1. <script>
  2. var go=(a)=>{
  3. return a;
  4. }
  5. var show=a=>a;
  6. console.log(show(10))
  7. </script>
  1. <script>
  2. function show(callback){
  3. var b = 20;
  4. callback(b);
  5. }
  6. show(res=>{
  7. console.log(res)
  8. })
  9. </script>