I have tried using console.log
so I can see the content of my array that contains multiple objects. However I get an error saying console.log
is not an
Json stands for JavaScript Object Notation really all json is are javascript objects so your array is in json form already. To write it out in a div you could do a bunch of things one of the easiest I think would be:
objectDiv.innerHTML = filter;
where objectDiv is the div you want selected from the DOM using jquery. If you wanted to list parts of the array out you could access them since it is a javascript object like so:
objectDiv.innerHTML = filter.dvals.valueToDisplay; //brand or count depending.
edit: anything you want to be a string but is not currently (which is rare javascript treats almost everything as a string) just use the toString()
function built in. so line above if you needed it would be filter.dvals.valueToDisplay.toString();
second edit to clarify: this answer is in response to the OP's comments and not completely to his original question.