DEV Community

Masaud Ahmod
Masaud Ahmod

Posted on

2

πŸ› οΈ 2 Simple VS Code & Debugging Hacks Every Developer Should Use! πŸš€

1️⃣ One VS Code Setting That Speeds Up Your Workflow ⚑

Many developers don’t realize how much time they waste on manual saving, mismatched brackets, and repetitive coding. Try these simple settings:

βœ… Auto Save: Automatically saves your work after a short delay.

"files.autoSave": "afterDelay"
Enter fullscreen mode Exit fullscreen mode

βœ… Bracket Pair Colorization: Highlights matching brackets for better readability.

"editor.bracketPairColorization.enabled": true
Enter fullscreen mode Exit fullscreen mode

βœ… AI-Powered Code Suggestions: Install Tabnine AI or Codeium to boost coding speed with smart autocompletions.

2️⃣ Stop Using console.log() – Try These Instead! πŸ”

console.log() is great, but there are better ways to debug your JavaScript code. Here are some game-changing alternatives:

πŸš€ Format data properly with console.table()

const users = [{ name: "John", age: 25 }, { name: "Jane", age: 30 }];
console.table(users);
Enter fullscreen mode Exit fullscreen mode

πŸš€ Use debugger; to pause execution and inspect variables in Chrome DevTools

function fetchData() {
  debugger; // Opens DevTools and pauses execution here
  return fetch("https://api.example.com").then(res => res.json());
}
Enter fullscreen mode Exit fullscreen mode
function fetchData() {
  debugger; // Opens DevTools and pauses execution here
  return fetch("https://api.example.com").then(res => res.json());
}
Enter fullscreen mode Exit fullscreen mode

πŸš€ Measure execution time with console.time()

console.time("fetchData");
fetchData().then(() => console.timeEnd("fetchData"));
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ Bonus Tip: If you’re not using these yet, start now and watch your debugging and workflow efficiency skyrocket! πŸš€

πŸ‘‰ Which trick did you find most useful? Let me know in the comments! πŸ”₯πŸ’¬

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay