Blogger Information
Blog 19
fans 0
comment 0
visits 10756
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JS中变量常量与函数的声明与使用过程
牙森江
Original
359 people have browsed it

1.JS变量和常量的使用过程

  1. // 声明一个变量用let:
  2. let a=5
  3. console.log(a);
  4. // 初始化变量 就是给声明的常量赋值:
  5. let b = 10;
  6. let c = 20;
  7. let d = b+c;
  8. console.log(d);
  9. //变量 后面 是可以更新 重新赋值的
  10. b = 10
  11. c = 20
  12. d = b+c;
  13. console.log(d);
  14. //声明一个常量用 const 常量名称用大写
  15. const USER = '第21期学员 '
  16. console.log(USER);

运行代码效果:

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