Using the toString() method you can convert the array to a string in JavaScript. This method returns a string representing the specified array and its elements.
array.toString()
Note: the toString method can’t be used on an array of objects because it will return [object Object] instead of the actual values.
Convert array to string in JavaScript
Simple example code print array as a string in the console.
<!DOCTYPE html>
<html>
<head>
<script>
const array1 = [100, 200, 'AAA', 'BBB'];
console.log(array1.toString());
</script>
</head>
</html>
Output:
Do comment if you have any doubts or suggestions on this JS array topic.
Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version