Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Remove the First Element from an Array</title> </head> <body> <script> let colors = ["Red", "Green", "Blue"]; let first = colors.shift(); document.write(first + "<br>"); // Prints: Red document.write(colors.length); // Prints: 2 </script> </body> </html>