Type Guards and Type NarrowingIn this post, we are going to cover what type guards and type narrowing are in the context of TypeScript. These are concepts you may have already been using and didn't know it or these may be totally Apr 12 · 6 min readbradpreston.hashnode.dev
Hoisting 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 readbradpreston.hashnode.dev
Throttling 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 readbradpreston.hashnode.dev
Preventing 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 readbradpreston.hashnode.dev
Handling 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 readbradpreston.hashnode.dev