/* config stuff... ignore this line */ console.config({ maximize: true, timeStamps: false });
// sample data
const values = [
1e100,
"a",
true,
new Date(),
x => 1,
/(?:)/ig,
undefined,
null,
document.querySelector("button")
];
// add a circular reference
values.push(values);
// log whole array with circular reference
console.log("array with circular reference: %o", values);
// log each value individually
values.forEach((v, i) => console.log("%i: %o", i, v));
// table output
console.table([
{ Name: "Zoe", Age: 20 },
{ Name: "Xander", Age: 21 },
{ Name: "Cthulhu", Age: Infinity },
]);
// throw a test error
throw new Error("test!");
<!-- console visualization; see http://meta.stackexchange.com/a/242491 -->
<script src="https://gh-canon.github.io/stack-snippet-console/console.min.js"></script>
<button>click me</button>