Blogger Information
Blog 19
fans 0
comment 1
visits 7424
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1013..
移动用户-4050479
Original
354 people have browsed it
  1. // * 循环
  2. const arr = [1 , 2 , 1 ]
  3. let s = 0
  4. while ( s < arr.length) {
  5. console.log(arr[s])
  6. s++
  7. }
  8. console.log('-----------');
  9. s = 0
  10. do {
  11. console.log(arr[s])
  12. s++
  13. }
  14. while ( s < arr.length)
  15. console.log('-----------');
  16. for (let s = 0 ; s < arr.length ; s++){
  17. console.log(arr[s]);
  18. }
  19. // * for-of 循环
  20. console.log('-----------');
  21. for (let item of arr){
  22. console.log(item);
  23. }
  24. console.log('-----------');
  25. arr.forEach(item => {
  26. console.log(item);
  27. });
  28. console.log('-----------');
  29. // * for-in
  30. const user = {
  31. id : 123 ,
  32. name : 564 ,
  33. }
  34. for (let item in user)
  35. {
  36. console.log(user[item]);
  37. }
  38. 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