java-script:console-table-error-assert-group
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
java-script:console-table-error-assert-group [2023/08/09 20:24] – ↷ Page name changed from java-script:console-table to java-script:console-table-error-assert-group odefta | java-script:console-table-error-assert-group [2023/08/09 20:33] (current) – odefta | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Java Script Console Error, Table, Assert ====== | + | ====== Java Script Console Error, Table, Assert, Group ====== |
===== Console table ===== | ===== Console table ===== | ||
Line 112: | Line 112: | ||
<note tip> | <note tip> | ||
One common approach to handle this is to have a build step in your deployment process that removes or comments out calls to console.assert() (and other debugging code) as part of the **[[java-script: | One common approach to handle this is to have a build step in your deployment process that removes or comments out calls to console.assert() (and other debugging code) as part of the **[[java-script: | ||
+ | </ | ||
+ | |||
+ | ===== Console group ===== | ||
+ | |||
+ | **console.group()** and **console.groupEnd()** are used in JavaScript to **group together related log messages**. \\ You can also nest groups inside other groups, creating a hierarchical view in the console. | ||
+ | |||
+ | Simple example: | ||
+ | < | ||
+ | console.group(" | ||
+ | console.log(" | ||
+ | console.log(" | ||
+ | console.groupEnd(); | ||
+ | </ | ||
+ | |||
+ | Output: | ||
+ | {{: | ||
+ | |||
+ | Nested group example: | ||
+ | < | ||
+ | console.log(" | ||
+ | |||
+ | console.group(" | ||
+ | console.log(" | ||
+ | |||
+ | console.group(" | ||
+ | console.log(" | ||
+ | console.groupEnd(); | ||
+ | |||
+ | console.group(" | ||
+ | console.log(" | ||
+ | console.groupEnd(); | ||
+ | |||
+ | console.groupEnd(); | ||
+ | |||
+ | console.log(" | ||
+ | </ | ||
+ | |||
+ | Output: | ||
+ | {{: | ||
+ | |||
+ | < | ||
+ | Using **console.groupCollapsed()** instead of console.group() can create a collapsible group that is closed by default. | ||
</ | </ |
java-script/console-table-error-assert-group.1691601883.txt.gz · Last modified: 2023/08/09 20:24 by odefta