Blogger Information
Blog 19
fans 0
comment 1
visits 7423
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1102作业
移动用户-4050479
Original
363 people have browsed it
  1. console.log(123, typeof 123);
  2. console.log("....................");
  3. //* 定界符 单双引号 反引号
  4. console.log(`123`, typeof 123);
  5. console.log("....................");
  6. //* 反引号 不光可以用来写字符串 还可以用来写模板
  7. const number = "123321";
  8. console.log(`尺寸 = ${number}`); //* ${} : 差值 / 占位符
  9. console.log("....................");
  10. //! 引用
  11. // ? 1. 数组
  12. const arr = [1, 2, "5555"];
  13. console.log("....................");
  14. console.log(arr);
  15. // * 判断数组 用 array.isArray()
  16. console.log(Array.isArray(arr));
  17. console.log("....................");
  18. // * 对象数组
  19. const array = [
  20. {
  21. 名字: "张三",
  22. 年龄: "23",
  23. },
  24. ];
  25. console.log(array);
  26. console.log("....................");
  27. console.log("ARR: ", array["名字"]);
  28. console.log("....................");
  29. // * 点语法
  30. console.log("ARR: ", array.名字);
  31. console.log("....................");
  32. // * 遍历数组
  33. array.forEach((item) => console.log(item));
  34. console.log("....................");
  35. // * 类数组 : 类似数组
  36. const lat = {
  37. // * 索引必须是数值 必须给length 表示元素数量
  38. 0: "color",
  39. 1: "img",
  40. length: 2,
  41. };
  42. console.log(lat);
  43. console.log("....................");
  44. // * 将类数组转为数组
  45. /* lat.forEach(item => console.log(item)); */
  46. Array.from(lat).forEach((item) => console.log(item));
  47. console.log("....................");
  48. // * 函数数组
  49. const eve = [
  50. () => {
  51. return "1";
  52. },
  53. () => {
  54. return "2";
  55. },
  56. () => {
  57. return "3";
  58. },
  59. () => {
  60. return "4";
  61. },
  62. ];
  63. // * 函数数组需要调用
  64. eve.forEach((item) => console.log(item()));
  65. console.log("....................");
  66. console.log("....................");
  67. // * 全局变量
  68. const cion = 123;
  69. const conn = () => {
  70. console.log(cion);
  71. };
  72. conn();
  73. console.log("....................");
  74. // * 私有变量
  75. const mov = () => {
  76. const cion = 2580;
  77. console.log(cion);
  78. };
  79. mov();
  80. console.log("....................");
  81. const sc = {
  82. id: 123,
  83. name: "WDBLZS",
  84. git: function () {
  85. return `${this.id}= ${this.name}`;
  86. },
  87. };
  88. console.log(sc.git());
  89. // * if 判断
  90. if (true){
  91. console.log(1);
  92. }
  93. console.log("....................");
  94. if (!true){
  95. console.log(1);
  96. }
  97. else {
  98. console.log(2);
  99. }
  100. console.log("....................");
  101. // * 三元运算
  102. const re = 5 + 6 < 5 ? true : false
  103. console.log(re);
  104. console.log("....................");
  105. // * 多分支
  106. var c = 59
  107. if ( c >= 80 ){
  108. console.log('A');
  109. }else if ( c > 70 ) {
  110. console.log('B');
  111. }else if ( c > 60 ){
  112. console.log('C');
  113. }else{
  114. console.log('D');
  115. }
  116. console.log("....................");
  117. c = 'A'
  118. switch (c) {
  119. case'A': console.log('A');break
  120. case'B': console.log('B');break
  121. default: console.log('M');break
  122. }
  123. console.log("....................");
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