How to print all the properties of the object in javascript? [duplicate]

There are heaps of solutions from a quick Google, a recomended result is; Print content of JavaScript object?

console.log(JSON.stringify(object, null, 4));

The second argument alters the contents of the string before returning it. The third argument specifies how many spaces to use as white space for readability.

Leave a Comment