Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Convert JavaScript Array to JSON string</title> </head> <body> <script> // Sample JS array let arr = ["Apple", "Banana", "Mango", "Orange", "Papaya"]; // Converting JS array to JSON string let json = JSON.stringify(arr); document.write(json); </script> </body> </html>