hw06_08.html 547 B

1234567891011121314151617181920212223
  1. <header>
  2. <h1>Reverse</h1>
  3. </header>
  4. <body>
  5. <script>
  6. const arr = [];
  7. arr.push(prompt("Enter element 1"));
  8. arr.push(prompt("Enter element2"));
  9. arr.push(prompt("Enter element 3"));
  10. arr.push(prompt("Enter element 4"));
  11. arr.push(prompt("Enter element 5"));
  12. alert(arr);
  13. const arr2 = [];
  14. arr2.push(arr.pop());
  15. arr2.push(arr.pop());
  16. arr2.push(arr.pop());
  17. arr2.push(arr.pop());
  18. arr2.push(arr.pop());
  19. alert(arr2);
  20. </script>
  21. </body>