The unt() method can make keeping track of how many times you’ve hit a point in your code really simple. This can be great for quickly perusing JSON data. Unbeknownst to many, the console has a built-in method for printing tabular data in table format. If you want humungous rainbows following everything, try this: Effective when venting frustration #6: Printing JSON as a Table You can punk your coworkers with a splash of rainbow to trail everything you output. You can also store CSS to use as styles in a variable to apply to output. Perhaps try printing a nice pill around output you want to emphasize: Required skills: HTML, CSS, and Quantum Computing Experience You can play the role of artist where the console is your canvas! You can do more than just implement the built-in formatting with console.log, warn, and error. In addition to console.log(), the console has several other functions to print data into the console in different predefined formats. This feels like it’s not that big a deal until you’re optimizing performance and do it a thousand times trying to figure out what egregious React sin you’ve committed. You skip out on wrapping the whole function in curly braces and adding a return. If you wrap the argument passed into console.log in What follows are some of the simplest tricks I’ve found for debugging in the console. Trust me on this one though, those prong thingies on the back of your hammer aren’t just for ripping out nails. In an ecosystem where tools, keyboard shortcuts, and API’s flow like milk and honey in the promised land, it’s hard to justify picking up a new hammer when your old one works just fine. The same idea can be applied to the console. “I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail.” -Maslow The law of the instrument states that it’s easy to develop overconfidence in a familiar tool. The console is the tool developers use when debugging their own applications. The console is one of the first tools developers learn about. By Kyle Gill Commanding the Javascript console Useful tricks for debugging, formatting, and efficiency
0 Comments
Leave a Reply. |