<!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 = ["BMW", "Mercedes", "Ferrari", "Tesla"];
document.getElementById("demo").innerHTML = fruits.toString();
</script>
</body>
</html>