Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Convert an Array into a Comma-separated String</title> </head> <body> <script> var colors = ["Red", "Green", "Blue"]; document.write(colors.toString()); // Prints: Red,Green,Blue </script> </body> </html>