Last Modified at 2020-03-22 18:11:38
In this tutorial, i am going to show you multiple methods of printing object array:
function that is used to convert object into a string.
var mycity=new Array();
document.getElementById('abc').innerHTML = JSON.stringify(mycity);
If you are debugging your code and want to print array using console.log()
function. See the code below: