console.log groups

JavaScript

Tidy up your console logs by grouping relevant logs together.

Explanation

  • console.group('Group Heading'): Starts a new group in the console.
  • console.groupEnd(): Ends the group.

Usage

To group console logs, use the following code:

console.group('Group Heading');
console.log('Log 1');
console.log('Log 2');
console.groupEnd();