Display objects and arrays as a table using javascript console methods in Salesforce Lightning Component

We can display as Table from console using Javascript console methods.

console.table()
https://developer.mozilla.org/en-US/docs/Web/API/console/table

You can use console.table to display objects and arrays as a table.

This can be a really handy way to visualize data, and we can use it in Salesforce Lightning Components (AURA/LWC) for debugging purpose.

Here simple way to Debugging in Lightning Components (AURA/LWC) using Javascript Console Objects called console.table()

Here is the Example to display table format in Lightning Components (AURA/LWC) 

Display Entire Table:

console.table(result);

Display Specific columns:
console.table(result,[‘Name’,’Type’]);

 

Written by 

13x Salesforce Certified | Application Architect | 2x Copado Certified | 2x Trailhead Ranger | 8+ years of experience in implementing CRM solutions on Salesforce Platform

Leave a Reply

Your email address will not be published.

*