Oops, I did it again: A guide to debugging common JavaScript errors

Ali Spittel on March 25, 2019

Writing JavaScript code can sometimes make us feel like running, hiding, or just being scared. But, with some debugging tips we can get in the zo... [Read Full]
markdown guide
 
 
function oneMoreTime(stillBelieve=true, loneliness=0) {
    if (!stillBelieve && loneliness < 0) return
    loneliness++
    return oneMoreTime(stillBelieve, loneliness)
}

This is poetry.

 

So now the question is which of the referenced songs am I listening to first...

I've always been partial to Everytime :)

 

First, if you're in an infinite loop, quit the tab if you're in Chrome or Edge, and quit the browser window in FireFox.

FireFox is a lot friendlier than this - you don't need to close the whole browser and you get a nice, friendly message:

too much recursion indeed!

 

Big fan of the Bracket Pair Colorizer extension! Before, I didn't know that something wasn't right, and it definitely gives you a sign!

 

I didn’t know about this extension. I’m totally going to try it out. It seems like it would save me a bunch of time.

 

const Ali = {
Name: 'Ali',
LovesBritney: true,
ShoutOut: function(){
console.log('Ali is awesome');
}

Ali.ShoutOut();

😅

 
 

Nice one Ali! We recently started using Prettier on one of our projects and I love it - it catches silly mistakes and quells syntax debates 🤘 thanks as always!

 

Read this last night and "Lucky" was stuck in my head all day today

 

#britneyspears

Sorry, just can't help myself when I saw the title...

 
 

Loved the way you explained the full stack issue, the rest I had a basic info about!
Still learnt something new 😃

 

It's wonderful!!!
Sometimes these errors makes anyone Crazy, but Everytime I got these errors, I'll remember this text.

 
 
 

This post is great! Ali has tons of info here with links to other resources too. This is a great resource for learning about why some of these really common errors happen. Nice work!

 

I need to write a post on a great follow up to this: debugging closures. I'm reminded of a big blocker I encountered when trying to debug an inner function one time.

code of conduct - report abuse