Console Log JavaScript Objects to See Data Structure [code snippet]


Console Log JavaScript Objects to See Data Structure [code snippet]

When working with JavaScript objects and arrays it is often tricky to reference the correct index of the data you need. These console functions allow you to visually see the structure so that job is a bit easier.

Writes your object as a data table and also dropdown menu

console.table($yourObject);

Writes your object as a string

console.log(JSON.stringify($yourObject))

Source



Written by: Jake Lett
Jake Lett is a B2B marketing consultant with over 15 years of experience in the digital marketing industry. He specializes in SEO, HubSpot, and PPC campaign management. Jake has a proven track record of helping businesses increase their online visibility and drive more traffic, leads and sales. He is a Certified Google Ads Specialist and a Certified HubSpot Developer.

Related posts

Tags:

Want to Get Email Updates of New Articles?

Join My Email Newsletter