bradpreston.hashnode.devHoisting in JavaScriptMaybe you’ve heard of hoisting or maybe this is a new term in your learning journey. Either way, understanding how hoisting works will help you understand how your code works. What the heck does hoisting even mean? By definition, when something is “h...Feb 13·4 min read
bradpreston.hashnode.devThrottling function calls in JavaScriptYou’re at a water park in line for your favorite water slide. Only one person is allowed to go down the slide every 15 seconds. This is implemented for safety. If every person when right after the other, we would have backups in the slide or injuries...Mar 2, 2025·4 min read
bradpreston.hashnode.devPreventing CLS with Dynamic ImagesWhen adding images to our websites, it’s crucial to prevent the layout from shifting while the image loads. Cumulative Layout Shift (CLS) can be described as unexpected movement while the page content is loading. For example, you go to click on a but...Feb 26, 2025·3 min read
bradpreston.hashnode.devHandling events on multiple items in JavaScriptWe’ve all been there. You have a list of items and each item needs to listen for an event. Maybe it’s a click event or mouseover event. Traditionally, you may have put an event listener on every item in the list, but what if I told you there was a be...Feb 16, 2025·3 min read
bradpreston.hashnode.devDebouncing in JavaScriptWhat is debouncing? Debouncing is a programming practice that is used to limit the rate that a function can be executed. In other words, it restricts the number of times a function is ran regardless of how many times it is invoked. Imagine you have a...Feb 11, 2025·3 min read