Chrome Console Console Usage

Source: Internet
Author: User

Chrome Console Console Usage

Let's take a look at what the console has to offer for debugging purposes.

The current console methods and properties are:

["$$", "$x", "dir", "Dirxml", "Keys", "values", "Profile", "Profileend", "monitorevents", "unmonitorevents", "inspect", " Copy "," Clear "," geteventlisteners "," Undebug "," Monitor "," Unmonitor "," Table "," $ "," $ "," $ "," $ $ "," $4 "," $_ "]

Let's take a look at the main uses of each method.

In general, the method we use to enter information is mainly used in the following four:

1, Console.log for the output of general information

2, Console.info for the output of informational information

3. Console.error for output error message

4, Console.warn for output warning information

To speak in a diagram:

6, Console.groupend end a set of output information

See you need to choose a different output method to use, if the above four methods together with the group and the GroupEnd method can be used to enter a variety of different forms of output information.

7, Console.assert the input expression to assert, only the expression is false, output the corresponding information to the console.

8, Console.count(This method is very practical OH) when you want to count the number of times the code is executed.

9, Console.dir (This method is I often use can not know how much more convenient than for in) directly to the DOM node in the structure of the DOM tree output, you can detail the method of object development and so on.

10, Console.time time to start. Console.timeend time is over (look at the picture below and you'll feel it in a moment)

11. Keys and values return the data that consists of all the property names of the incoming object, which returns an array of all the property values.

12.Console.table method

13. The Chrome console natively supports jquery-like selectors, meaning you can use $ the familiar CSS selector to select the DOM section.

14 . Use Console.profile and console.profileend together to view CPU usage related letters.

How to use the Chrome console console

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.