From system development using JavaScript and NodeJS Found that using the command console.log() is a lot Often, the result is not as desired. Therefore introducing a little more Console
Console usage Let's get started.
Basic Console API In JavaScript
Most will find in the debug of the work system as follows.
Let's look at some other useful methods.
1. Console.table()
Display data of objects and arrays in a tabular format. Which is easy to read and easy to understand.
2. Console.assert()
Check the submitted value to be true or false. If the value entered is false and will write a log for us to see But if true it will not display the log The false value consists of 0, false, blank, etc.
3. Console.count()
For counting values or counting work times Very useful when we debug a system. Especially those with a strange life cycle will make us understand work more easily Which will be used together with Console.countReset()
4. Console.group()
Make log groups easier to read and understand By beginning with usage Console.group() And finish with Console.groupEnd()
Console usage Let's get started.
Basic Console API In JavaScript
Most will find in the debug of the work system as follows.
- console.log () encountered the most.
- console.warn ()
- console.error ()
Let's look at some other useful methods.
1. Console.table()
Display data of objects and arrays in a tabular format. Which is easy to read and easy to understand.
2. Console.assert()
Check the submitted value to be true or false. If the value entered is false and will write a log for us to see But if true it will not display the log The false value consists of 0, false, blank, etc.
3. Console.count()
For counting values or counting work times Very useful when we debug a system. Especially those with a strange life cycle will make us understand work more easily Which will be used together with Console.countReset()
4. Console.group()
Make log groups easier to read and understand By beginning with usage Console.group() And finish with Console.groupEnd()
Comments
Post a Comment