You will make errors when you code. And no, it doesnβt matter whether youβre a novice or an expert. Even experts make errors.
The difference?
When a novice encounters an error, they panic. Their minds go blank. They refuse to believe that their logic was wrong. They insist their code βshouldβ work.
Experts, on the other hand, recognize that errors are part and parcel of programming life. Something has definitely slipped their minds if they encounter an error. They use the opportunity to find and fix the error.
To become a good developer, the #1 skill is to be able to figure out what went wrong, and make the necessary adjustments. This is a process known as debugging.
How to debug
Watch this video. Iβll show you how to debug in 5 minutes :)
Exercise
Are there any errors with the following code? If yes, find out what they are and fix them.
<a class="button" href="#">Link that looks like a button</a>const button = document.querySelector('button')
button.addEventListener('click' e => { console.log('Button clicked!'))})Welcome! Unfortunately, you donβt have access to this lesson. To get access, please purchase the course or enroll in Magical Dev School.
Unlock this lesson