screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Array Example</title> <script> document.addEventListener('DOMContentLoaded', function () { const myArray = [11, 2, 33, 4, 65]; const firstElement = myArray[0]; const lastElement = myArray[myArray.length - 1]; // Display output on the webpage document.getElementById('output').innerHTML = ` <p>Original Array: [${myArray.join(', ')}]</p> <p>First Element: ${firstElement}</p> <p>Last Element: ${lastElement}</p> `; }); </script> </head> <body> <div id="output"></div> </body> </html>