Latest Posts

I write about front-end web development. I'm inspired by Nathan Barry's motto, teach everything you know. I also take a lot of inspiration from my friend and mentor, Chris Ferdinandi.

Returning boolean values in JavaScript

In today’s post, I want to talk about a common issue I see in beginners’ code. It’s not wrong, per se, but it can be made more efficient. Here’s a way you can make your code cleaner when returning boolean values.

How to empty an element in vanilla JS

In jQuery, we can remove all child nodes from an element using the empty() method. Let’s create a helper function for this using only vanilla JS.

How to scope your selectors in vanilla JS

You can use the native querySelector() and querySelectorAll() methods to get an element or set of elements from the DOM. But did you know you can scope these methods so they only search within a particular element?