Blogger Information
Blog 19
fans 0
comment 1
visits 7379
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1101 作业
移动用户-4050479
Original
399 people have browsed it
  1. let av = 'name'
  2. //* 函数
  3. function getUserName (b) {
  4. return b ;
  5. }
  6. console.log(getUserName(av))
  7. //* 字面量 =>不可复用
  8. '\(^o^)/~'
  9. //* 变量
  10. let ace = 100
  11. console.log(ace);
  12. //* 变量用 let 常量 const
  13. const USER_ID = 1223
  14. console.log(USER_ID);
  15. //* 常量更新会报错
  16. //* 定义首选 const 用let除非必要更新
  17. //* 函数类型 :
  18. //* 匿名函数
  19. const a = 1 , b = 2
  20. const sumc = function ( a , b ){
  21. return a + b ;
  22. }
  23. console.log(sumc (a,b));
  24. //* 首先匿名函数
  25. //* 命名函数
  26. function sumx ( a , b ){
  27. return a + b ;
  28. }
  29. console.log(sumx (a,b));
  30. //* 箭头函数 => 匿名函数的简化 语法 :
  31. const sumn = ( a , b ) =>{
  32. return a + b ;
  33. }
  34. console.log(sumn (a,b));
  35. //* 立即执行函数
  36. //* 语句被 () 包起来就会变成表达式 写完立即执行
  37. const sumv = (( a , b ) =>{
  38. return a + b ;
  39. })(20,50)//* 用来传参
  40. console.log(sumv);
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post