Some lessons from front-end debugging

Source: Internet
Author: User

I've never written a log information code for program debugging (reason: 1. Lazy. 2. Console.log () will not be spelled. 3. Rely on the debug breakpoint), so I developed a low efficiency, has been thought to be able to one step, the result of a flop, affecting the development progress.

Therefore, I want to learn this lesson, the future development must write the log code, can not be too dependent on debug breakpoint debugging.

Where to write the log is as follows:

1. Send data content (parameters).      

suggest JSON data is best to format output

var str = json.stringify (obj, NULL, 2);//The third parameter is a formatted

Console.log (str)

2. Accept the data content (parameters).

Some lessons from front-end debugging

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.