Special statement

This article is a series by Tomek Sułkowski published on Medium. According to the author revealed a total of 24 articles, updated until December 24, the copyright of the original author.

I have sent the translation links of the first two articles to the author himself. Although he does not understand Chinese, he is still very happy. The screenshots are at the end

The translator had already communicated with the author before the translation to get permission to translate the whole series. In order not to disturb your reading, the record of authorization is here

The body of the

In the 24 days leading up to the holiday season, I will be Posting a series of short posts on how to use development tools in a more interesting way. Yesterday we finished number 15, and today we only have one tip, but it will be quite a surprise:

16. Print out objects that don’t match your expectations

Hey, this will really blow your mind and complicate or fail our console.log-based debugging process.

Objects printed on the Console are kept as references until they are printed.

What does that mean? For example: you print an object, then modify it, and then print it out – when we look at it in the Console, we see that the first printed record (before the modification) and the second printed record (after the modification) have the same value!

If you’re still confused after this description, don’t worry, this process in the following video should make it clear:

Now imagine what happens when you want to figure out when an object has been modified. How do you deal with that?

You can print objects copied from this object, or… We will continue to discuss this issue in a future article, using breakpoints or resource panels that we can rest assured of during formal debugging.

Routine: If you learn something new from this

→ Follow me on Twitter: Tomek Sułkowski

Other series

Other articles in this series will be translated soon, with links posted here.

  • Day 1: ‘$’ in the Console
  • Tips you might not know about Chrome debugging tools Day 2: Copying & Saving
  • Chrome debugging tools you didn’t know about
  • The Chrome debugging tool has a few tricks you don’t know about.
  • Day 5: Console log, puzzling case
  • You don’t know the Command menu for Chrome
  • 7. Fun tips you didn’t know about the Chrome Debugging Tool Consle
  • Chrome’s Color picker is a Color picker that you don’t know about.
  • Day 9: Time console
  • Custom Formatters are custom formatters for Chrome.
  • Today: Style Editors continued
  • Tips you don’t know about the Chrome Debug Tool Day 12: Ninja Log Print! (the ninja logs)
  • Chrome debugging Tool tips you didn’t know about
  • Chrome Debugging Tool tips you didn’t know About day 14: Other shortcuts
  • Chrome debugger tips you didn’t know about
  • Tips you don’t know about Chrome debugging Tools 16: Breakpoints
  • Day 17: Farewell to Console
  • What you Didn’t know about Chrome Debug Tools
  • Chrome debug tool tips you don’t know
  • Tips you didn’t know about Chrome debugging tools Day 20: The dark arts of Workspace
  • Tips you Don’t Know about Chrome Debugging Tools Day 21: Snippets
  • Chrome Debugging Tool tips you didn’t know
  • Chrome debug Tool tips you don’t know
  • Day 24: The last day, New Year’s Day, is awesome

Write in the last

If you are sure of my translation, you can also pay attention to my wave oh ~ incidentally my open source project, for a wave of star→ see here, beautiful blog system

About this translation, the author’s reply