JavaScript Array Methods
Converting Arrays to Strings The JavaScript method toString() converts an array to a string of (comma separated) array values. Example <!DOCTYPE html> <html> <body> <h2>JavaScript Array Methods</h2> <h2>toString()</h2> <p>The toString() method returns an array as a comma separated string:</p> <p id=”demo”></p> <script> const fruits = [“Banana”, “Orange”, “Apple”, “Mango”]; document.getElementById(“demo”).innerHTML = fruits.toString(); </script> </body> </html> Result: JavaScript… Read More »