Editor Arrow Download Open
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>JavaScript reverse array do...while loop</title> </head> <body> <pre> <!-- Use pre element for work document.writeln() method --> <script> var arr = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; number = arr.length - 1; // array index start from 0 do{ document.writeln("Value of arr[" + number + "] : " + arr[number]); }while (number--) document.writeln("End of Loop."); </script> </pre> </body> </html>
  Preview Arrow