Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Concatenate Two Arrays in JavaScript</title> <script> // Sample arrays var array1 = ["Red", "Green", "Blue"]; var array2 = ["Apple", "Kiwi"]; // Concatenating the arrays var result = array1.concat(array2); document.write(JSON. stringify(result)); </script> </head> <body style="font-family: monospace;"> <!-- Result array will be printed here --> </body> </html>